-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Remember whether the welcome screen was seen #2375
base: master
Are you sure you want to change the base?
Conversation
group-income Run #3259
Run Properties:
|
Project |
group-income
|
Run status |
Passed #3259
|
Run duration | 09m 29s |
Commit |
2a33df9d6f ℹ️: Merge 08bcfdf514550278005e11732118d5ca5f2b1139 into b64ecda81d1b1c9574b1b4490945...
|
Committer | Ricardo Iván Vieitez Parra |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
10
|
Skipped |
0
|
Passing |
111
|
@@ -52,6 +54,14 @@ export default ({ | |||
toDashboard () { | |||
if (this.isButtonClicked) return | |||
this.isButtonClicked = true | |||
const groupContractID = this.currentGroupId |
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'm wondering whether this should be here, or if instead it should be done on the /dashboard
page on onMounted
. Maybe it doesn't matter.
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.
Pros of doing it here: it's only done once (for users). Pros of doing it in the /dashboard
page: we don't need to change the commands.js
in the tests. Cons of doing it in the /dashboard
page: need to do this check every time.
2ce1c8c
to
83a69ce
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.
Nice work @corrideat! Review ready!
@@ -283,8 +283,7 @@ sbp('chelonia/defineContract', { | |||
throw new Error(`Cannot leave group ${groupContractID} because the reference hash does not match the latest`) | |||
} | |||
|
|||
state.groups[groupContractID].hasLeft = true | |||
delete state.groups[groupContractID].inviteSecret | |||
state.groups[groupContractID] = { hash: reference, hasLeft: true } |
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.
There might be other attributes on groups
that you're overwriting here that shouldn't be overwritten.
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.
There aren't. This is when leaving a group, so we should keep the attributes there at a minimum.
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.
It's true that there aren't at the moment, but in the future if more attributes are added then developers must remember to update this code to make sure nothing breaks. Whereas the way it worked before didn't need as much attention.
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.
but in the future if more attributes are added then developers must remember to update this code to make sure nothing breaks
Nothing should break because these are chatroom that we're not part of. Note that attributes are already overwritten when joining a chatroom. The only reason we keep these values around at all (before we deleted the whole thing) is for accounting purposes, so that re-joining works correctly.
then developers must remember to update
I think this is a good thing. You shouldn't need attributes from chatroom you're not a part of. The only exception I can think of is for a future feature that allows you to 'block' a chatroom (to prevent re-joining), in which case it makes sense to be explicit.
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.
Either way, making things as they were before still means that developers need to pay attention to this. If a foo
attribute were to be added, which is not used after having left, it needs to have a corresponding delete
here.
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.
ok that last comment makes sense... can you add a comment here explaining that?
]), | ||
...mapState([ | ||
'currentGroupId' | ||
'currentGroupId', | ||
'' |
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.
This ''
seems like a bug
const state = sbp('state/vuex/state') | ||
return sbp('gi.actions/identity/setGroupAttributes', { | ||
contractID: state.loggedIn.identityContractID, | ||
data: { | ||
groupContractID: state.currentGroupId, | ||
attributes: { seenWelcomeScreen: true } | ||
} | ||
}).then(() => router.push({ path: '/dashboard' })) |
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.
Is there a way this can be DRY'd? (Repeated above)
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'm not entirely sure. It could maybe be a Cypress command.
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.
Review ready!
No description provided.