Skip to content

Task/10323 save and reopen a project in s3 mode - #846

Merged
briemla merged 12 commits into
mainfrom
task/10323-save-and-reopen-a-project-in-s3-mode
Sep 30, 2026
Merged

briemla merged 12 commits into
mainfrom
task/10323-save-and-reopen-a-project-in-s3-mode

Conversation

@randy-seng

@randy-seng randy-seng commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

What this does

When a project was opened from a named location in s3 mode, saving it now just works: no save dialog pops up, the file goes straight back to where it came from, and a copy is uploaded to s3 automatically. Saved files for these s3 projects no longer list video/track paths, since those point at temporary local files that don't exist once the project is reopened elsewhere.

Notes for the reviewer

  • The core decision (upload or not, and what to log) lives in SaveOtconfig (OTAnalytics/application/use_cases/config.py).
  • The change to what's included in a saved file is a small, isolated check in OTAnalytics/plugin_parser/otconfig_parser.py.
  • Most of the remaining diff is just making the save flow wait properly for the upload to finish — no behavior change outside s3 mode.

Risk and rollout

Nothing changes for projects not using s3. For s3 projects, saved files will no longer include video/track file paths — nothing currently depends on those being there, but it's worth flagging in case something downstream expected them.

OP#10323

@randy-seng
randy-seng added this pull request to stack #837 September 28, 2026 07:58
@randy-seng
randy-seng force-pushed the task/10323-save-and-reopen-a-project-in-s3-mode branch 4 times, most recently from e6558ce to 47a7ed5 Compare September 29, 2026 14:44
@randy-seng
randy-seng requested a review from briemla September 29, 2026 15:16
@randy-seng randy-seng self-assigned this Sep 29, 2026
@randy-seng
randy-seng force-pushed the task/10323-save-and-reopen-a-project-in-s3-mode branch from fa41c9d to 4bfd035 Compare September 29, 2026 15:40
Base automatically changed from task/10322-let-the-project-declare-its-key-prefix to main September 30, 2026 06:47
…3 mode

Data is picked per session by time range (OP#10283), so a project's own
file references have no reader in s3 mode; recording them would only
leave stale paths into the ephemeral user_source staging area behind.
The omission lives inside OtConfigParser.convert, keyed off s3_key_prefix,
so SaveOtconfig's save and OtconfigHasChanged's comparison agree by
construction even if the live repositories drift between the two calls.
A project that names a key prefix arrived through an operator naming it
(POST /load_otconfig or --config), not a picker, so saving it always
re-saves to its own name and place with no new UI: SavePathSuggester
already resolves there. GuardSaveDestination refuses a destination that
does not lie under user_source/<prefix>/ before the file is written, and
UploadOtconfig puts the saved file back under that prefix afterwards.
Both are wired to no-ops outside s3 mode.

SaveOtconfig, QuickSaveConfiguration.save, Application.save_otconfig and
Application.quick_save_configuration are now async so the upload -
S3Upload.upload is async - can be awaited; every caller was already
async at the viewmodel layer, so this is plumbing rather than a new
concurrency boundary.
The destination guard added alongside the s3 upload refused saving an
otconfig outside user_source/<prefix>/. Saving should always succeed
locally regardless of destination; only whether it also uploads to s3
depends on the project naming a key prefix. Drops GuardSaveDestination
and its s3 implementation.
Info-level logging so an operator can see, from the log alone, where a
save landed and whether it also went to s3 - covering the quick-save
path too, which never went through the viewmodel's own save logging.
Loading an otconfig with track files over HTTP always failed: OTCloud hands
its UI Worker an otconfig through a plain endpoint, whose task carries no
NiceGUI slot, and NiceguiProgressbar.open() resolved context.client, which
raises on an empty slot stack. A missing page context now counts as having
no browser to show the dialog in, like the startup preload already did.
The form outlives the page it is built into, so once that page's browser has
left, NiceGUI deletes its client and the form holds a deleted label. clear()
resolves the element's client and raised, failing every otconfig loaded after
the first visit to the page. set_text() goes through update(), which skips a
deleted element. A label has no children, so the clear() did nothing on a
live page either.
@briemla
briemla force-pushed the task/10323-save-and-reopen-a-project-in-s3-mode branch from 7e8f611 to a72f0a4 Compare September 30, 2026 06:47
@briemla
briemla merged commit 79e0cd0 into main Sep 30, 2026
15 checks passed
@briemla
briemla deleted the task/10323-save-and-reopen-a-project-in-s3-mode branch September 30, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants