-
Notifications
You must be signed in to change notification settings - Fork 5
Add a option to force currentUser update to getSessionCurrentUser #1541
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
base: 09-17-ensure_current_user_is_updated
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.
Not a blocker but would be mighty cool of you if you'd at least consider doing the suggested changes if they make sense to you. And "it can be done later" is a cheap copout.
const isStale = _storage.safeGetValue(STALE_KEY); | ||
if (!(typeof isStale === "string") || !(isStale === "no")) { | ||
if ( | ||
forceUpdateCurrentUser || | ||
!(typeof isStale === "string") || | ||
!(isStale === "no") | ||
) { |
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.
Nitpicks:
- There's no need to read
isStale
ifforceUpdateCurrentUser
is true - The pattern of
!(x === y)
sort of read out likeno(yes)
, which IMO is a bit confusing. Why not just usex !== y
? - Using the strict equality operator (
===
) inisStale === "no"
already checks for the type, so the check withtypeof
is redundant
Put together, this would reduce into
if (forceUpdateCurrentUser || _storage.safeGetValue(STALE_KEY) !== "no") {
Is guaranteed to return either "yes" or "no" (i.e. no undefined
oslt), it might be better to use _storage.safeGetValue(STALE_KEY) === "yes"
to avoid that "not 'no'" scenario again.
f446eed
to
a5a3db6
Compare
fce63a7
to
b8891d1
Compare
ESLint and CodeQL checks are failing because Graphite created a temporary branch when I was fixing and submitting code in each PR in order. (someone has limited the maximum amount of pushes to 2 in a single command and graphite normally tries to do the whole stack at once to prevent needing to create temporary branches) |
a5a3db6
to
48c96f4
Compare
bb9c261
to
ec751c6
Compare
48c96f4
to
67a0ad8
Compare
No description provided.