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

Delete Relation when deleting token #16

Open
brunocalado opened this issue May 18, 2023 · 5 comments
Open

Delete Relation when deleting token #16

brunocalado opened this issue May 18, 2023 · 5 comments

Comments

@brunocalado
Copy link

Hi.

What do you think about delete relations when deleting a token?

chrome_eYFFHnGmZQ.mp4

Tks

@wlonk
Copy link
Owner

wlonk commented May 24, 2023

Thank you so much for the feedback (here, and with the other issues you raised)!

I’ve begun working on a fix for this one, but there are some weird edge cases that are remaining tricky. I hope I can resolve it this weekend.

wlonk added a commit that referenced this issue May 28, 2023
But it still throws an error on the originating client for each outbound
edge, because the token is deleted before the socket comes back around
and tells the client to clean up (again, which it already has done).

See #16.
@wlonk
Copy link
Owner

wlonk commented May 28, 2023

Well, I've gotten it to the point where it works, but there's an error thrown for the client that originated the deletion, for every outbound edge from the token. There's something happening where a socket event comes in late that tells the client to do… what it's just done, but the relevant token is already gone and so it can't find it to clean up data.

At this point, that's just a wart I'm going to have to live with for it, because I don't have the capacity to clean it up.

@brunocalado
Copy link
Author

Thank you for fix this!

About the error, I have some suggestions:

@wlonk
Copy link
Owner

wlonk commented May 28, 2023

Thanks; I'm active in that Discord already.

I don't see how to bring socketlib to bear on this, yet. I'll keep pondering this for a bit. I think that socketlib is most clearly applicable to situations where you need an action to run consistently, once, or with elevated permissions, once, and then have the results spread out; in this case, it has to do with the originator receiving something like a bounced socket event. As I say, I'll contemplate it.

@wlonk
Copy link
Owner

wlonk commented May 29, 2023

I just tried the re-architecture where everything goes through socketlib to happen via one GM user, and no good; the error is still a loopback-shaped one (in broad terms). I think if this feature's going to be present, it'll take someone with a deeper knowledge of Foundry internals and patterns than I have to make it error-free.

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

No branches or pull requests

2 participants