-
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
Add a option to force currentUser update to getSessionCurrentUser #1541
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
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 |
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
67a0ad8
to
c7c481d
Compare
ec751c6
to
1d4ac35
Compare
No description provided.