Skip to content
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

Merged
merged 5 commits into from
Sep 6, 2023

Conversation

patrickhuie19
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@patrickhuie19 patrickhuie19 requested a review from jmank88 August 29, 2023 13:37
@patrickhuie19 patrickhuie19 force-pushed the fix/BCF-2497-session-error-log branch 2 times, most recently from 1672250 to d915889 Compare August 29, 2023 13:48
core/sessions/orm.go Outdated Show resolved Hide resolved
@patrickhuie19 patrickhuie19 force-pushed the fix/BCF-2497-session-error-log branch from d915889 to 00d005d Compare September 5, 2023 12:24
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
Copy link
Contributor Author

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.

Comment on lines +62 to +64
{"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(), ""},
Copy link
Contributor

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.

@patrickhuie19 patrickhuie19 added this pull request to the merge queue Sep 5, 2023
@cl-sonarqube-production
Copy link

github-merge-queue bot pushed a commit that referenced this pull request Sep 5, 2023
… 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
github-merge-queue bot pushed a commit that referenced this pull request Sep 5, 2023
… 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
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2023
@patrickhuie19 patrickhuie19 added this pull request to the merge queue Sep 5, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2023
@patrickhuie19 patrickhuie19 added this pull request to the merge queue Sep 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 6, 2023
@patrickhuie19 patrickhuie19 added this pull request to the merge queue Sep 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 6, 2023
@patrickhuie19 patrickhuie19 added this pull request to the merge queue Sep 6, 2023
Merged via the queue into develop with commit 6f8a302 Sep 6, 2023
@patrickhuie19 patrickhuie19 deleted the fix/BCF-2497-session-error-log branch September 6, 2023 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants