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

Question: Disposal/Teardown patterns in FDC3 #1263

Open
Tracked by #1317
Davidhanson90 opened this issue Jul 16, 2024 · 3 comments
Open
Tracked by #1317

Question: Disposal/Teardown patterns in FDC3 #1263

Davidhanson90 opened this issue Jul 16, 2024 · 3 comments

Comments

@Davidhanson90
Copy link

Question Area

[X ] Other

Question

I am looking at the concept of a multiple agents to single window proposal. I am considering that applications can be loaded and unloaded. I had a previous discuss with @kriswest who pointed me to the getAgent working document. I am wondering what spec support their is for destroying agents? if there is no clear guidance on this, are there other patterns which could be referenced such as channel teardown? Note, I did take a look at the channel types and could not find the equivalent of destroy or dispose.

@kriswest
Copy link
Contributor

I don't think we've discussed this properly yet, added to tomorrows meeting agenda:

@kriswest
Copy link
Contributor

FYI Channel listener, intent listener and event listener subscriptions are all covered by the Listener object (and its unsubscribe() fn) returned by the relevant add*Listener function. We did do some basic thinking about tear down in FDC3 for the web (contrary to what I said above) - a DA could poll a particular property on MessagePorts to see if they are still alive (catching window closes and crashes) but we have yet to add a specific disconnect message (perhaps tied to an onBeforeUnload handler in the client library code. THats something we shoudl think about!

@kriswest
Copy link
Contributor

Notes for SWG meeting 22/08/24:

  • There was some discussion of background to this issue (raised by @Davidhanson90), including how containers (the traditional focus of FDC3) haven't needed any explicit tear-down calls as they tend to create connections on the opening of a window and then clean up when the observe it closing.
  • There was consensus that there is not a clear use case for disconnect() call or similar for conventional FDC3 use.
  • However, there is a clear need in web browsers as Desktop Agents can't as easily observe that a window is closed/has closed. It is to listen for a MessagePort closing, but the event may not fire if a render thread crashes, hence, implementations should periodically check the port is still working.
    • A goodbye message should be added to the Web Connection Protocol to handle tear-down and the client code can call it automatically via onBeforeUnload - however implementors would still be advised to retain instance details for apps as they may reconnect quickly, e.g. after a navigation event.
  • Further, Support for Multiple Application Scopes (Agents) within a single window process #1250 is intended to solve for cases where there may be multiple 'apps' or 'widgets' within a single page, and each needing to ahve a distinct identify in FDC3 so that they can interoperate with each other as well as other applications via FDC3.

WCP6Goodbye added for disconnection 56a41bb
@Roaders @robmoffat

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