-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AppSessionId #793
Add AppSessionId #793
Conversation
…ocedural macro for generating ToSql/FromSql implementation
2b14035
to
40cd74f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part 1
core/market/migrations/2020-10-04-190200_agreement_events/up.sql
Outdated
Show resolved
Hide resolved
core/market/migrations/2020-10-04-190200_agreement_events/up.sql
Outdated
Show resolved
Hide resolved
|
||
use crate::db::model::{OwnerType, Proposal, ProposalId, SubscriptionId}; | ||
use crate::db::schema::market_agreement; | ||
|
||
pub type AgreementId = ProposalId; | ||
pub type AppSessionId = Option<String>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as this is user input, we need to check if this is at most 100 chars. Is there a unit test for such a case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know, we have such a limit. Is it documented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have implicitly set this limit via up.sql
;)
log::warn!( | ||
"Agreement Event with not parsable Reason in database. Error: {}. Shouldn't happen \ | ||
because market is responsible for rejecting invalid Reasons.", e | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: I'd also return this warning mesage as a proper JsonReason for the clients to be aware and can report if it happens one day
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean, that you would set this error message in JsonResponse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and extend this message to contain whole reason contents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhh, it was big. But here it is
Co-authored-by: Piotr Chromiec <tworec@golem.network>
7e0b5d4
to
7e1d011
Compare
const DEFAULT_EVENT_TIMEOUT: f32 = 0.0; // seconds | ||
const DEFAULT_QUERY_TIMEOUT: f32 = 12.0; | ||
const DEFAULT_EVENT_TIMEOUT: f32 = 5.0; // seconds | ||
const DEFAULT_QUERY_TIMEOUT: f32 = 5.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
below you can find examlpe how to handle invalid user input for appSessionId
ie. len > 100 chars in this case
resolves: #726
Contains changes from: #754
which resolves: #729