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

Post Refactor update to session coordinator #1518

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mobile-bungalow
Copy link
Contributor

here are speculative changes that would need to be made to the swiftui client if my refactor landed in it's current state.

var opts = NavOptions()
opts.joinParams = .some([ "_interface": .object(object: LiveSessionParameters.platformParams)])
opts.action = .replace
let _ = try await client.navigate(next.last!.url.absoluteString, opts)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a problem here, core now runs it's own even loop and will take patch and redirect events, these are currently not handled if they are not triggered by a client action. Those events are all pushed through SimpleEventHandler.viewReloadSubject. We need to watch for events that are emitted by server-side events and rectify the navigation path.

the other option is just to call the appropriate client navigation functions wherever we would previously just modify the navigation 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 not following the specific issue here. Can you provide more detail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously the swiftui client listened on the live view channel for live_reload and other push_navigation type events, then it would modify the LiveSessionCoordinator.NavigationPath and all navigation would happen downstream of checking for changes in the scan block like we do here.

Now that push navigation events are handled opaquely inside core, we need to update the LiveSessionCoordinator.NavigationPath in response to internal events. While the code provided here works, the NavigationPath should be controlled by core, which is the opposite of how it works now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nice :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and yes, I agree

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

Successfully merging this pull request may close these issues.

2 participants