-
Couldn't load subscription status.
- Fork 364
Contacts quality of life fixes #2738
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
Conversation
| this.setState({awaiting: false}); | ||
| props.history.push(`/~groups${destination}`); | ||
| }); | ||
| api.contactView.delete(props.path); |
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 surprised this fires given we're about to push to another view.
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.
The other call is asynchronous, but good point, I can remove the race condition.
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 why we call both the view and the hook here, instead of having the view call the hook for us. It already does that too, I believe:
urbit/pkg/arvo/app/contact-view.hoon
Lines 148 to 152 in 65cad93
| %delete | |
| %+ weld | |
| :~ (group-poke [%unbundle path.act]) | |
| (contact-poke [%delete path.act]) | |
| (contact-hook-poke [%remove path.act]) |
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.
The hook does not do the same action, as the contactHookRemove API in the JS is sending a contact-action to the group owner, not a contact-hook-action to ourselves.
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 looking at this, I could make the view perform the action. Making this change.
|
@loganallenc happy to continue discussion in here, or present some thoughts around a renewed "reconnect" interface in an interface review at some point. Either way, I'll post up some thoughts/a link re: this pretty soon. |
|
The two fixes aren’t QoL, they’re bugs; if the design iteration is minor (within a day) then sure, otherwise, don’t necessarily hold this back. |
|
Agreed, I want to implement the display / resubscribe flow within contacts later, but wanted to alert Ed to the details of it. This is good to go as is. |
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.
(Also noticed that contact-hook seems to do (some of) the same that I fixed for chat-hook in #2746. Not saying that needs to change now, but we should keep it in mind.)
| this.setState({awaiting: false}); | ||
| props.history.push(`/~groups${destination}`); | ||
| }); | ||
| api.contactView.delete(props.path); |
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 why we call both the view and the hook here, instead of having the view call the hook for us. It already does that too, I believe:
urbit/pkg/arvo/app/contact-view.hoon
Lines 148 to 152 in 65cad93
| %delete | |
| %+ weld | |
| :~ (group-poke [%unbundle path.act]) | |
| (contact-poke [%delete path.act]) | |
| (contact-hook-poke [%remove path.act]) |
pkg/arvo/app/contact-hook.hoon
Outdated
| ^- (list card) | ||
| :: local | ||
| ?: (team:title our.bol src.bol) | ||
| ?. (~(has by synced) path) ~ |
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.
Why do we suddenly want to silently no-op instead of crash here?
Shouldn't this be above the team check, so we have consistent behavior (ie not crash) between local and foreign pokes?
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.
Because the contact-hook ~(got by synced) can throw a noisy error message that doesn't matter as long as we have done the contact-view-delete.
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.
we have done the contact-view-delete.
We shouldn't be calling this anymore if we've already done that, right? Or is my understanding of how we use this hook wrong?
I'm worried about this making the "we tried calling it but it's not there because of [some bug]" completely silent, harder to catch.
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 the path isn't in synced, the remove method should do nothing.
pkg/arvo/app/contact-hook.hoon
Outdated
| :_ state | ||
| [%pass contact-path %agent [our.bol %contact-store] %watch contact-path]~ | ||
| :~ [%pass contact-path %agent [our.bol %contact-store] %watch contact-path] | ||
| [%give %fact ~ %contact-hook-update !>([%initial synced])] |
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.
You probably want [%give %fact [%synced path.act]~ ... for this, and the %facts below? ~ outside of the "someone just subscribed" context just means "send this to nobody".
Might also be nice to refactor these into a +send-synced-update or some such card creation function.
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.
Good point.
| %+ turn ~(tap by synced.upd) | ||
| |= [pax=^path shp=^ship] | ||
| ^- [cord json] | ||
| [(spat pax) s+(scot %p shp)] |
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.
Might be slightly cleaner to use (ship:enjs:format shp) here. nbd
|
I did some more in-depth testing yesterday and uncovered a reproducible group-hook bug relating to leaving and re-joining. Fixing today. |
821eb1b to
6d4a694
Compare
|
This has been heavily tested and the style complaints satisfied. |
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 good to go!
groupafter apersonal breach#2696