Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tacryt-socryp
Copy link
Contributor

@tacryt-socryp tacryt-socryp commented Apr 14, 2020

this.setState({awaiting: false});
props.history.push(`/~groups${destination}`);
});
api.contactView.delete(props.path);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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:

%delete
%+ weld
:~ (group-poke [%unbundle path.act])
(contact-poke [%delete path.act])
(contact-hook-poke [%remove path.act])

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@urcades
Copy link
Contributor

urcades commented Apr 15, 2020

@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.

@matildepark
Copy link
Contributor

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.

@tacryt-socryp
Copy link
Contributor Author

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.

@matildepark matildepark requested a review from Fang- April 15, 2020 17:41
Copy link
Collaborator

@Fang- Fang- left a 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);
Copy link
Collaborator

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:

%delete
%+ weld
:~ (group-poke [%unbundle path.act])
(contact-poke [%delete path.act])
(contact-hook-poke [%remove path.act])

^- (list card)
:: local
?: (team:title our.bol src.bol)
?. (~(has by synced) path) ~
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

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 the path isn't in synced, the remove method should do nothing.

:_ 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])]
Copy link
Collaborator

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.

Copy link
Contributor Author

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)]
Copy link
Collaborator

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

@tacryt-socryp
Copy link
Contributor Author

I did some more in-depth testing yesterday and uncovered a reproducible group-hook bug relating to leaving and re-joining. Fixing today.

@tacryt-socryp tacryt-socryp force-pushed the la-contact-delete-fix branch from 821eb1b to 6d4a694 Compare April 21, 2020 19:17
@tacryt-socryp
Copy link
Contributor Author

This has been heavily tested and the style complaints satisfied.

@tacryt-socryp tacryt-socryp requested review from Fang- and removed request for ixv April 21, 2020 19:20
Copy link
Collaborator

@Fang- Fang- left a 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!

@jtobin jtobin merged commit 5b9887c into master Apr 22, 2020
@jtobin jtobin deleted the la-contact-delete-fix branch April 22, 2020 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants