Skip to content
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

[Zoe] UserSeat.exit() and ZCFSeat.exit() should have same behavior? #1421

Closed
katelynsills opened this issue Aug 10, 2020 · 5 comments · Fixed by #1414
Closed

[Zoe] UserSeat.exit() and ZCFSeat.exit() should have same behavior? #1421

katelynsills opened this issue Aug 10, 2020 · 5 comments · Fixed by #1414
Assignees
Labels
enhancement New feature or request

Comments

@katelynsills
Copy link
Contributor

What is the Problem Being Solved?

@erights had previously said that if UserSeat.exit() and ZCFSeat.exit() had the same name, they should have the same behavior. In other words, if UserSeat.exit() is present, the seat should be exited without condition, like ZCFSeat.exit(). At the time, we thought that feature testing UserSeat.exit() would work. But @dtribble pointed out that UserSeat will be a presence and feature testing doesn't work on presences. The current state of zoe-release-branch is that UserSeat.exit always exists but may or may not exit.

We need to determine if this behavior is acceptable, or if there is a better solution.

@katelynsills katelynsills added the enhancement New feature or request label Aug 10, 2020
@dtribble
Copy link
Member

dtribble commented Aug 11, 2020

Since

  • the client made the offer
  • the "exit" option is part of the proposal that's available on the seat

The client can be reasonably expected to eitehr know by contruction or find out what exits are possible. Thus, there's no loss of function if calling exit on a userSeat throws (rejects the result promise) if it's invoke on a seat that cannot exit.

There are exit cases (not currently supported) that are optional (e.g., "waived" or "only after a time but not automatic"), so alternatively it returns a boolean as to whether exit was allowed.

@erights
Copy link
Member

erights commented Aug 12, 2020

The client can be reasonably expected to eitehr know by contruction or find out what exits are possible. Thus, there's no loss of function if calling exit on a userSeat throws (rejects the result promise) if it's invoke on a seat that cannot exit.

There are exit cases (not currently supported) that are optional (e.g., "waived" or "only after a time but not automatic"), so alternatively it returns a boolean as to whether exit was allowed.

But this is a major semantic difference between the two exit methods. When the user is not allowed to exit using the userSeat, the contract can always the zcfSeat. Since we can't use feature testing to avoid this divergence, I still think they need different names.

@katelynsills
Copy link
Contributor Author

For the different names, what about userSeat.attemptExit() or userSeat.tryExit()? The fact that it may not be successful is the only semantic difference, so I think attempt/try captures that

@katelynsills katelynsills self-assigned this Aug 12, 2020
@erights
Copy link
Member

erights commented Aug 12, 2020

Prefer `tryExit, but I'm good with either. Thanks.

@katelynsills
Copy link
Contributor Author

Renaming to tryExit on the UserSeat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants