-
Notifications
You must be signed in to change notification settings - Fork 15
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
treaty: subscribe for treaties to prevent race condition #268
Conversation
What is a sovereign treaty? Do I need to somehow give a landscape/desk/app/treaty.hoon Lines 344 to 353 in 77c1cc8
|
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.
What is a sovereign treaty? Do I need to somehow give a /treaties/ship fact here also?
A "sovereign treaty" is one we are publishing ourselves. These are stored separately, in the sovereign
map.
Since the new /treaty/[ship]
subscription endpoint you added (in +on-watch
) doesn't currently give initial results from the sovereign
map, it would be wrong to give facts for any changes there.
But, arguably, we should pull results from sovereign
in addition to treaties
.
...The scry endpoint doesn't account for that though, and in the common case it probably doesn't matter?
[%treaties @ ~] | ||
:_ this | ||
=/ =ship (slav %p i.t.path) | ||
=/ alliance (~(get ju allies) ship) |
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 is the case for the scry too, but I'm kind of surprised this isn't doing a (~(put in alliance) ship)
, to make sure the ship we're actually explicitly asking about is also in there, always.
I found a problematic case on ~wolref-podlex. He was failing to see almost any desks in the software distribution UI when searching for a ship even with my previous fix applied. When investigating his This is very likely caused by this piece of code: landscape/desk/app/treaty.hoon Lines 61 to 64 in 9e8258e
Sometimes the frontend adds an ally with the It is unclear how many ships are affected by this issue. To make sure everybody has their |
Co-authored-by: fang <[email protected]>
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 think the approach here might be preferable to #269 because it gives you a way to "full refresh" for any given ally. The frontend probably shouldn't be doing that willy-nilly though.
Either way, as written this should be a straight improvement on existing behavior, so I'd be happy with merging it. We can always continue tweaking later.
When you search for a ship for the first time in the landscape software distribution UI it's very common to enter a scenario where the UI gets stuck on "X apps found, waiting for entries", yet the entries never show up until you refresh the page. Whether you hit this case seems to be dependent on how fast the %vitals connection check completes.
This PR fixes the issue by having the frontend subscribe to the treaty instead of scrying for it. This requires a new
/treaties/ship
subscription endpoint which is also implemented here.