-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
BCF-2497: Refactoring sessions orm query pattern to avoid a confusing rollback tx error log #10378
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
1672250
to
d915889
Compare
d915889
to
00d005d
Compare
func (o *orm) updateSessionLastUsed(sessionID string) error { | ||
return o.q.ExecQ("UPDATE sessions SET last_used = now() WHERE id = $1", sessionID) | ||
} | ||
|
||
// ErrUserSessionExpired defines the error triggered when the user session has expired |
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.
If I do another revision, I'll remove this comment - it should be clear from the Error message what it is used for.
{"expired", "correctID", cltest.MustParseDuration(t, "0m"), sessions.ErrUserSessionExpired.Error(), ""}, | ||
{"incorrect", "wrong", cltest.MustParseDuration(t, "3m"), sessions.ErrUserSessionExpired.Error(), ""}, | ||
{"empty", "", cltest.MustParseDuration(t, "3m"), sessions.ErrEmptySessionID.Error(), ""}, |
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.
nit/ could switch wantError
to type error
, and then do a require.ErrorIs
or whatever instead of string comparison.
SonarQube Quality Gate |
… rollback tx error log (#10378) * fix/BCF-2497-session-error-log: refactoring sessions orm to avoid a confusing rollback tx error log * fix/BCF-2497: updating changelog * fix/BCF-2497: refactoring out redundant query implementations * fix/BCF-2497: decomposition and redundancy refactoring
… rollback tx error log (#10378) * fix/BCF-2497-session-error-log: refactoring sessions orm to avoid a confusing rollback tx error log * fix/BCF-2497: updating changelog * fix/BCF-2497: refactoring out redundant query implementations * fix/BCF-2497: decomposition and redundancy refactoring
No description provided.