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

FreshnessChecker broke the ability to embed online applications #1258

Open
JakeWharton opened this issue Feb 26, 2024 · 1 comment
Open

FreshnessChecker broke the ability to embed online applications #1258

JakeWharton opened this issue Feb 26, 2024 · 1 comment

Comments

@JakeWharton
Copy link
Collaborator

The Redwood test+sample apps want this behavior for application loading:

  • Guest code is bundled into binaries at build time
  • Guest code is loaded from the network, if available
  • Network code always takes precedence over embedded code
  • Newer network code always takes precedence over cached network code

This worked prior to 1.7.0 with embedded code and using the built-in development server push Flow operator.

Now, with FreshnessChecker, we seem to only be able to toggle between two modes: the embedded application is considered fresh so the network is never checked, or nothing is fresh so the network is only used.

If a real application was relying on an offline-capable, first-run experience with an embedded copy, this behavior change means that functionality was broken.

It seems like the capability of the freshness checker needs expanded to differentiate the embedded code from the network code. Either with a different policy for the cutover between the two, or just with its own policy.

The EventListener also should probably propagate the source of the code (embedded, cache, or network) in its callbacks around code loading. This should make it possible to also monitor when embedded code has successfully loaded but network code has failed, or perhaps that requires additional callbacks.

@JakeWharton
Copy link
Collaborator Author

Internally we agreed on the need for a stale-while-revalidate behavior that can be opted into.

I don't remember if we said anything else was needed.

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

No branches or pull requests

2 participants