Repository navigation
fix(hosting,inertia,client): per-tab i18n catalogs; adapter owns Inertia cache rules; lazy layout props - #805
Merged
Merged
Conversation
…tia cache rules; lazy layout props - client reports the catalog it holds (`X-SM-I18n: <locale>:<audience>`) and the server sends messages only on a mismatch, so a second tab is not left on the old language; non-rendering requests no longer touch the legacy session marker; one defensive reload when locale and catalog disagree (#788) - simple_module_inertia exports is_inertia_request/INERTIA_HEADER and its middleware forces `private, no-store` and drops ETag on page payloads; hosting's InertiaCacheMiddleware and its divergent header checks are gone (#790) - layout shared props (menus, providers, i18n) resolve once, on demand, for pages and error pages; permissions stay eager (#791) Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
…ddleware saw A 500 page resolves them after TenantMiddleware unbound its tenant. Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
…e the GH #272 rationale Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
…790) Setup gate, auth login-redirect, branding shared props and the demo guard used truthiness or == 'true'; they now use is_inertia_request (presence), re-exported from simple_module_hosting.inertia_deps for modules. Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
- error page renders without layout props when building them fails - i18n recovery reload clears its flag when the visit finishes - adapter error handler uses is_inertia_request - docs: shared props are resolved lazily (resolve_inertia_shared) Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
- OIDC and Keycloak logout views use is_inertia_request (presence) - resolve_inertia_shared exported from simple_module_hosting.inertia_deps; docs and CHANGELOG point there - shipped skill simple-module-inertia-pages: lazy shared props, per-tab i18n catalog header and audience Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
Deploying simple-module-python with
|
| Latest commit: |
4cee8a8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://21e8d6b6.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-hosting-review-inertia-i.simple-module-python.pages.dev |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
X-SM-I18n: <locale>:<audience>on every Inertia visit, and the server sendsmessagesonly on a mismatch. A second tab no longer stays on the old language after a locale switch. Without the header (older clients), the legacy session comparison stays, but only page-shaped requests write the marker. The client reloadsonly: ['i18n']once if its locale and catalog disagree.simple_module_inertianow exportsis_inertia_request/INERTIA_HEADER(presence semantics). ItsInertiaMiddlewareforcesprivate, no-store, drops ETag on page payloads and addsVary: X-Inertia, so standalone adapter users are covered too. Hosting'sInertiaCacheMiddlewareand its divergent checks are removed. EveryX-Inertiacheck now uses presence: error negotiation, i18n, setup gate, auth login redirect, OIDC/Keycloak logout, branding, the users demo guard and the adapter's error handler. Modules import the helper viasimple_module_hosting.inertia_deps./apiJSON calls. Permissions stay eager. The build runs in the request context the middleware saw, so a 500 page keeps the tenant. An error page whose layout build fails still renders.simple-module-inertia-pagesskill are updated.Closes #788
Closes #790
Closes #791
Verification
8234with en+es: two tabs (a locale switch reaches the second tab), catalog omitted when unchanged, Inertia cache headers, 404 layout, re-login catalogmake lint,make test-py(7541 passed),make test-js(891),make doctorall green; e2e suite 53 passedQA Report
X-Inertia: 1)Test plan
https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq