Repository navigation
Public module APIs: in_delivery, forget_resource, render_error_page, worker_tenancy (#682 #683 #684 #685) - #705
Merged
Conversation
…, error page, worker tenancy (#682, #683, #684, #685) Replace private-name workarounds smpy_modules pins: - simple_module_core.durable_events.in_delivery() / IN_DELIVERY: true while a durable handler runs (outbox deliver_one and inline dispatch), inherited by tasks it spawns (#682). - sharing.contracts.forget_resource(db, resource_type, resource_id(s)): delete a purged resource's shares in the caller's tenant and transaction (#683). - simple_module_hosting.render_error_page(request, status, detail, headers=None): JSON for API clients, the Inertia Error page for browsers (#684). - background_tasks.sync_db.worker_tenancy() -> WorkerTenancy | None: the worker's tenancy, None when never configured (#685). Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Deploying simple-module-python with
|
| Latest commit: |
d00abf2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dc90131e.simple-module-python.pages.dev |
| Branch Preview URL: | https://tech-debt-b27-public-module.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.
Public module APIs requested by smpy_modules (
images), replacing private-name workarounds it currently pins intests/test_framework_pins.py.Closes #682
Closes #683
Closes #684
Closes #685
What changed
simple_module_core.durable_events.in_delivery()(andIN_DELIVERY, aContextVar[bool]).deliver_oneand in the bus's inline durable dispatch.finally.deliver_one.__code__.sharing.contracts.forget_resource(db, resource_type, resource_id | Iterable[str]). Deletes every share of a purged resource in the caller's session and bound tenant, with no authorization check, since it is the owning module cleaning up. Documented next to the user and tenant cleanup.simple_module_hosting.render_error_page(request, status_code, detail, headers=None, *, required_permission=None). The standard error page for module exception handlers: JSON for API clients, the InertiaErrorpage for browsers, with the same negotiation as the framework's own handlers.background_tasks.sync_db.worker_tenancy() -> WorkerTenancy | None. A frozenWorkerTenancy(multi_tenant, default_tenant), orNonewhenset_database_urlnever ran, so a worker can tell "not configured" from single-tenant without reading underscored globals.Verification
make lint✓ ·make test-js✓ ·make test-py✓ (6439 passed, 39 skipped)forget_resourceis tenant-scoped and accepts a single id or an iterable;render_error_pagenegotiates JSON vs. the Inertia page and keeps status and headers;worker_tenancyreturnsNonewhen unconfigured, plus single- and multi-tenant snapshots.https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4