* fix(ra): count RomM's own RA hash match as RetroAchievements verification
The RetroAchievements verification chip, the header Verified badge and the
library verified filter only read Hasheous' `ra_match` flag. RetroAchievements
hashes only part of some ROMs (NDS, PSP), so Hasheous never flags those from
their file hashes, and a ROM RomM matched to its RA game by RA hash still
showed a grey chip.
The RA handler now records `hash_match` in `ra_metadata` whenever the ROM's
RA hash is one RetroAchievements lists for the matched game, whichever route
found the game (hash lookup, Hasheous-supplied id, filename tag, update scan
or a manual edit). The frontend verification helper and the backend verified
filter count it alongside Hasheous' flag. Existing ROMs pick it up on their
next scan.
Fixes#4801
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfQbq2ZUFK53NMXPNktdaM
* style: satisfy trunk isort and no-emdash-in-comment
Sort imports with the repo's .isort.cfg and replace the comment em-dashes
in MetadataTab.vue that trunk flags once the file is modified.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfQbq2ZUFK53NMXPNktdaM
* fix(ra): address code-review findings on the RA hash match
- A HASHES rescan whose RA lookup ran and found nothing clears
`hash_match`, mirroring the Hasheous guard; a lookup that errored keeps it.
- A manual RA id change that can't be resolved no longer keeps the previous
game's `hash_match`.
- `_search_rom` no longer caches a failed hash-list download ({}) as an
empty index for the whole refresh window.
- Update the `verified` filter description and trim the romVerification
header comment.
Step: pr-ready code-review (xhigh --fix)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfQbq2ZUFK53NMXPNktdaM
* fix(ra): don't let a failed hash check block an RA ID lookup
`get_rom_by_id` now treats the hash-list check as secondary: on failure it
logs, keeps a match already recorded for the same game, and still returns
the game. A failed hash-list download raises "RetroAchievements
unavailable" instead of reading as "no match", so scans treat RA as
inconclusive and keep the stored flag.
Addresses the Copilot and Greptile review findings on ra_handler.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfQbq2ZUFK53NMXPNktdaM
* refactor(ra): simplify the RA hash-match verification
- Cache the parsed RA hash index per platform, keyed by the cache file's
mtime, so a scan parses it once instead of once per ROM.
- Check the hash only after `get_rom_by_id` has resolved the game.
- Give each frontend verification database its own `matches(rom)`, which
drops the `ra_match` special case in the shared helper along with
`matchesDatabase` and `VERIFICATION_KEYS`.
Step: pr-ready simplify
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfQbq2ZUFK53NMXPNktdaM
* style(v2): polish romVerification naming and comment
Rename the Hasheous matcher factory to `anyHasheousFlag` and trim the
VERIFICATION_DATABASES comment to two lines.
Step: pr-ready review-polish
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfQbq2ZUFK53NMXPNktdaM
* fix(ra): keep a recorded hash match only for the same RA hash
When the hash-list check fails, `get_rom_by_id` now keeps a stored
`hash_match` only if both the game and the ROM's RA hash are unchanged, so
a rehashed ROM isn't left verified by a hash nobody checked. The
romVerification tests build on the shared typed `SimpleRom` fixture
instead of casting a bare object.
Addresses the Greptile review findings on ra_handler.py and
romVerification.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfQbq2ZUFK53NMXPNktdaM
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
compare_save_state decides a side changed from its timestamp, and
emulators rewrite a save on exit, so an untouched save looks new and a
server change elsewhere turns into a false conflict.
device_save_sync now records what each side held at the last sync
(last_sync_hash from the device, last_sync_server_hash from the server,
migration 0140). A baseline match proves that side unchanged; a mismatch
or NULL falls back to the timestamp logic, so this only removes
conflicts. It runs after the removed_at check in compare_save_state.
- Baselines are recorded only for versions the device provably holds:
confirm_download pins to the served version, update_save records the
client hash only when the file was uploaded, deduplicated uploads and
pushed saves record against the surviving save, and push-pull no-ops
record hashes only for identical content.
- Identical-content no-ops in negotiate and the watcher record a
boundary without re-tracking untracked saves.
- The SSH push-pull and file-transfer watcher paths hash device saves
through hash_save_file, matching compute_content_hash for zipped
saves, and treat unreadable saves as unknown.
Squashes rommapp/romm#4768 onto master.
Claude-Session: https://claude.ai/code/session_01WAKUdfLb6fyduEqaFbf5A8
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
is_system was true exactly when system_key is set, so 0137 now drops it
after backfilling the key, and downgrade rebuilds it from the key. The
group API returns system_key instead, and the admin UI reads it for the
system tag and edit warning.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The streaming config now ships import_kinds per container, from the broker's
cached import-spec, so the picker hides foreign saves and states a broker would
refuse instead of failing them after the launch starts.
On DuckStation and RPCS3, a save pick other than the newest archive no longer
lets that archive's own exit state stand in for the picked state: the state
rides the import archive, or the resume is reported lost where the broker
cannot import it.
* Tell a device when the save it holds was deleted here
Deleting a save took its row, its file and its device pairings, leaving nothing
that says it ever existed. A negotiation then read a client still holding the
save as a client with a save the server lacks, answered "upload", and the next
launch put the deleted save back. There was no way to say "this is gone": the
protocol's actions are upload, download, conflict and no_op.
So a slot emptied on purpose is now remembered. `deleted_saves` keeps one row
per (user, rom, slot) with what the slot held and when it was emptied, written
by the delete endpoint, which is the only place a deletion is the owner's
decision rather than housekeeping: autocleanup rotating a version out leaves
newer rows in the slot and is never recorded.
Negotiation reads it only when the slot has no row left, and answers the new
"delete" action when the client's copy is the one that went: the same content
hash, or a copy last written before the deletion. Anything written after it is
progress the server never held, so that still answers "upload" -- emptying a
slot is not a licence to delete a newer save.
The generated frontend models are hand-edited to match: this environment has
only CPython 3.14.0rc2, which the locked pydantic cannot import, so the backend
will not start for `npm run generate`. Both edits are mechanical (the new
literal in the union, the new count field), and `npm run typecheck` passes
against them.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U
* Decide a deletion by identity, and record it before the row goes
Three real findings from the review, and the layering rule.
The record was written after the save row and its file were gone, with two
transactions and a filesystem removal between them. Anything failing in that
window left a deletion nothing remembered, which is the resurrection this
change exists to prevent. It is written first now: a record for a save that is
somehow still there is never read, because a negotiation only consults it when
the slot has no row left.
The client's copy was matched on its own timestamp against the server's
deletion time. Those clocks are not comparable, and a device running slow
would have been told to delete progress it made after the deletion. The match
is now identity alone: the slot remembers every version it lost, capped at the
twenty most recent, and a client holding any of them is told to drop it.
Anything else is offered back, which costs a deletion that does not reach that
device rather than a save that is gone.
Recording replaced the row with a delete and an insert, which two deletions of
the same slot could race into a uniqueness error. It locks the row and merges
into it, with the house savepoint-and-catch for the case where there is no row
yet to lock.
The comparison itself moves to handler/sync/comparison.py beside
compare_save_state, where the endpoint delegates to it and the rule is tested
on its own.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U
* Trim the new comments to the repo's rule
One or two lines each, with the rationale in the commit messages and the PR
description where the rule puts it. The model's docstring is one sentence, and
the comparison keeps its Args and Returns.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U
* Sort comparison imports
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U
* Widen the window a deletion is remembered in
A slot's record keeps a bounded list of the versions it lost, and the trim
drops the oldest, which are exactly the ones a long-offline device is
likeliest to still hold. At twenty, a device that missed twenty
delete-and-refill cycles of one slot comes back with a digest that has
aged out and is answered `upload`, which puts a deleted save back.
Raised to a hundred, where the device would have had to miss a hundred
manual deletions of the same slot. The residual is deliberate and cannot
be designed away by a longer list alone: past the bound the server does
not know those bytes were deleted, and the answer degrades to `upload`,
which fails by not propagating a deletion rather than by destroying a
save. A test now names that case so the next reader meets it as a choice
rather than as an oversight.
Found by Greptile on #4674.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U
* Trim the retention comments back to the rule
Both were over the two-line limit, and the constant's was a six-line
design essay of exactly the kind the last round of this review already
removed from this PR. The reasoning belongs in the commit that made the
change and in the pull request, where it is.
What stays is the part the code cannot say: the trim drops the oldest,
and past the bound a device is answered `upload` rather than `delete`.
Found by Greptile on #4674.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U
* Name the deletion record for assets, not only saves
Unreleased, so the table can take a name that states can share later
without another migration.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Apply code-review fixes to deletion records
Record a deletion in short separate transactions so concurrent first
deletions no longer deadlock on MariaDB, hash a save that never
recorded one, keep a re-deleted version from being trimmed, scope the
negotiation's read to emptied slots, and require total_delete.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Simplify deletion records
Drop the unread deleted_at column, record from _delete_save so every
caller of it is covered, skip a record no hash could ever match, let
comparison decide delete vs upload with its reason, count actions once,
and fold the near-duplicate tests.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Polish the deletion record's index comment
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
pr-ready step 3 (simplify), plus the dialog changes asked for while it ran.
- A service that gives out its own URL (Discord, Slack, ntfy...) is set up
from that URL alone. The catalog lists the fields such a URL fills in
(url_fields), and the dialog shows only what it lacks, such as Discord's
bot name, which a URL read no longer wipes.
- Reading a URL checks that its fields rebuild the same URL, so a misread
token is refused instead of saved.
- Bot name gets a translated label; "Advanced options" is a small text toggle.
- Simplify: compiled template patterns cached per service, one table of
token patterns, parse_bool for flags, the log collector reordered, the
paste state reset in one place, the About tooltip state as a list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pasting a service's own URL (a Discord webhook's) or an Apprise URL
in the channel dialog fills its fields in as soon as it's pasted, or
says why it can't. POST /api/notification-channels/apprise-services/parse
instantiates the plugin and matches the URL Apprise writes for it
against the service's templates, so it works for every service; a new
channel moves to the service the URL is for.
- A failed delivery's error carries the start of the service's reply
after Apprise's warning, so a 400 says why (Discord refuses a bot name
containing "discord"). Apprise's log stays out of the server log.
- Setup guides link Apprise's wiki instead of appriseit.com.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Leave FCM out of the catalog: its keyfile token makes Apprise open a
local path or fetch a URL itself.
- Treat credential-named tokens as secrets even when Apprise doesn't
(Mastodon, Misskey, Plivo, SMSEagle, LaMetric, Rocket.Chat, a JSON
path), and hide any secret left in the masked target or in the
errors that reach last_error and the logs.
- A secret left out of an edit keeps its value, an empty one removes it,
and a kept secret no longer follows the channel to another host,
port, schema, SMTP server or ntfy mode. The form offers "Remove it"
for stored secrets and names them through `stored_secrets`.
- Break up @everyone, @here and <@…> so a notification pings nobody, as
the removed Discord payload did.
- Keep only the fields the service takes, cap lists at 20 items, and
accept only a hostname or address as a host.
- Give the channel test the same 60 s budget as a queued delivery, and
build the service catalog response once per process.
- Don't require a stored secret list (Bark) again on edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Forward notifications to any of the 100+ services Apprise reaches instead
of the two hand-coded webhook formats. The channel form lists every
Apprise service with the fields it takes, and the backend builds the
Apprise URL from them.
- New `apprise` channel type, admin only: Apprise opens its own
connections, past the SSRF guard. The owner's role is checked again at
every delivery.
- GET /api/notification-channels/apprise-services describes each service
from Apprise's plugin details: URL tokens as fields, options as
advanced fields. A field is required only when every URL template
needs it.
- A channel stores the service and its fields sealed; the URL is built
from the template those fields fill at each send. Local schemas, the
options that read files and the ones RomM sets are never offered.
Apprise follows no redirects, does not retry and its timeouts are
capped.
- The RomM JSON webhook keeps its payload and HMAC signature; its
Discord and ntfy formats go, Apprise covers them. Email is unchanged.
- The v2 dialog picks the type from one searchable list and renders the
service's fields, options folded under "Advanced options".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The launch socket payloads, the 409 busy detail and the card-import answer
were hand-written in services/api/streaming.ts and could drift from the
backend models they mirror.
- Publish Socket.IO payload models into the OpenAPI components
(utils/openapi.py), starting with the three streaming launch events.
- Raise the busy 409 from a ContainerBusyDetail model and declare it on
the game and desktop claim routes.
- Derive MemoryCardImport from ClaimStreamingSessionRequest, and type the
list and control calls with their generated response models.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The overview's media section was fixed to scraped screenshots plus videos.
Each user can now pin any screenshot (scraped, game folder, their own or a
community upload), any artwork and any video to their own overview, in any
order.
Pins live on rom_user.pinned_media as an ordered list of stable keys
(scraped:<url>, file:<id>, screenshot:<id>, artwork:<key>), written through
the existing PUT /roms/{id}/props. NULL keeps the default selection, so
nothing changes until a user pins or unpins something, and "Reset to
default" returns to it. Keys whose media disappears are skipped, not
pruned.
- The Artwork subtab's shelf becomes MediaShelf, shared with the overview.
- The Screenshots subtab gains a read-only "Scraped" section so scraped
screenshots can be unpinned too.
- Toggles are optimistic and chained so rapid clicks land in order.
- pinned_media is left out of the per-user sort cache bump.
Supersedes #4512.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Port the branch's emulator labels and live-state flag onto master's typed
streaming schemas, and carry the labelled state reason into
useSaveStateTabs now that the EmulatorJS view delegates to it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- PUT /collections/{id}/visibility and /collections/smart/{id}/visibility
flip is_public alone. The settings switch used the full update, which
rewrote membership from the client's rom_ids and ran the cover branch.
- update_save, update_state and update_screenshot derive the file-name
columns from file_name, like update_rom does for fs_name, so the rename
path hands them a name instead of building the columns itself.
- Name fields use notBlank, AssetEditDialog picks its own title from its
type, ScreenshotEditDialog shares one canSubmit, the collection tile and
row drop a virtual guard their callers already cover, and PublicBadge
uses the pill radius token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saves and states could only be renamed by downloading, renaming and
uploading them again (#2653).
Backend: PUT /api/saves/{id}/file-name and PUT /api/states/{id}/file-name
rename the file on disk and the row, and take the auto-captured thumbnail
along so it stays bound by stem. A name another save/state of the ROM
holds, or one that would bind another screenshot, is a 409. Renaming
keeps updated_at, like the other annotations, so device sync does not
see a new version.
Frontend (v2): the Save data tab's per-row actions are now download,
edit, favorite and delete. Edit opens one form with the file name (stem
preselected), labels and visibility; a taken name is flagged in the
field. Public saves and states carry the same globe badge as shared
screenshots. RTextField now puts `autofocus` on its native field, which
is what RDialog looks for, so autofocused fields in dialogs get focus
instead of the close button.
Fixes#2653
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A failed login keeps the attempted username only when it names an
account, so a password typed into the username box is never stored.
- Gunicorn trusts X-Forwarded-For only from loopback and private ranges
(FORWARDED_ALLOW_IPS, documented in env.template), so a client can no
longer choose the address the audit log and rate limits see.
- A player's fetch (purpose=play) is recorded as rom.player_load instead
of being skipped, so the marker can't hide a download.
- Play-session ingest treats a rom hidden from the caller as unknown, so
its session and rom.play event don't name it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Hide events on roms of a hidden platform from non-admins.
- Pin later pages to the highest matching id the API returns, not the
first row's: rows are ordered by when they happened, so a play synced
late has a higher id than newer events and was dropped.
- Cap recorded failed sign-ins per address, dedupe reset requests and
record them in the background with the email, and hash claim keys.
- Keep another user's private collection by id only in bulk downloads.
- Check a Range start without int(), which raises past 4300 digits.
- Clear the list when a reload fails, load more only once it's shown,
report a cover change only when the user made one, label only rom and
platform unhides, accept an actor kind the API doesn't know.
- One client IP helper, date-fns for today and yesterday, one time
formatter for the list, no em-dashes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings › System › Audit log lists what every user, and RomM itself,
did, newest first: who, what (a sentence built from the event, linking
to its target while it exists), when, and the device and address it
came from. Filters for user, category, date range and a search live in
the URL; later pages stay pinned to the first so new events don't shift
them. Only admins see the entry, and the route guard turns away anyone
else, including a group granted users.read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A kept tag only fills an empty region or language slot: the row's
value may come from a source the scan didn't ask either (a gamelist),
and a hash source's old answer mustn't replace it. Fresh answers still
work as before.
- A rehash that drops the Hasheous match now does so before the tags are
resolved, so the ROM doesn't take tags from the match it's losing.
- One reader for this scan's blob and the stored one, every tag field
recorded (empty lists included), and one ordered list of claims instead
of a dict plus a list.
- The applied sources and the hash sources are ordered in one pass, since
each pass rereads config.yml, instead of adding a read per ROM.
- Tests: one fixture per lookup, the blob assertion folded into the
translated-dump test, and new ones for the gamelist case and the
dropped Hasheous match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The regions, languages and tags a hash-matched source (ScreenScraper,
Hasheous) gave a ROM were only known while that source answered. A scan
that didn't ask it, such as an UPDATE with only IGDB selected or an
UNMATCHED scan of a ROM Hasheous already matched, rebuilt the tags from
the filename and the sources it did ask, and dropped them: the row can't
say which of its tags came from where.
Each hash source now keeps the tags its dump gave in its own blob
(dump_regions, dump_languages, dump_tags), and a scan that doesn't hear
from a source the ROM still carries the id of reads them from there. A
complete rescan still clears the id and blob of a source it drops, so
those tags go with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A channel's min_level is its own enum (info, warning, error), so the
API refuses `success` and neither the list nor the dialog maps it.
- One home each for the admin-reaches-the-LAN rule (the DB handler now
returns the owner's role) and for describing a failed delivery.
- One webhook config builder for create and update, which drops the
secret of a Discord webhook on both.
- SMTP_SECURITY outside starttls/tls/none leaves email off, so the
heartbeat says so, with a warning at startup.
- The attempts counter gets its TTL in the same round trip as INCR.
- Deliveries group channels by user and serialize a notification only
when a channel wants it.
- The v2 side reuses errorMessage (now with a fallback) instead of its
own detail parsing, mirrors the backend length limits as constants,
shares one channel test factory, and derives `created` on save from
the list instead of carrying it on the event.
- Drop RBadge's inline override, which nothing needs now that an inline
badge gets no anchor class, and trim docstrings to one sentence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Bound a webhook delivery: 15 s in all, and only the first KiB of a
refusal's body is read, so a hostile endpoint can't hold the API or a
worker with an endless or slow reply.
- Key the confirmation-code cooldown per user and per address instead of
per channel, which a delete and re-create reset, so a user can't mail
an address without limit.
- Don't carry a stored secret to another origin or format: it has to be
given again (Discord, which uses none, drops it), so a changed URL
can't be used to read an ntfy token or HMAC key.
- Refuse a webhook URL whose port isn't a number; one got saved and then
broke the channel list with a 500.
- Refuse an unknown SMTP_SECURITY instead of logging in over plaintext.
- Tell the reset form whether reset links are really emailed, which also
needs a shareable ROMM_BASE_URL (heartbeat NOTIFICATIONS.EMAILS_RESET_LINKS).
- Say a code went out only when the address is new to the channel.
- Match a channel's address whole, so a trailing newline isn't kept.
- Test that forgot-password answers alike and sends the link afterwards,
and document the new cache keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Channels tab, for every user, lists their webhooks and email addresses
with their filters and last delivery or error, and lets them add, edit,
test, turn off and delete each one. An email address is confirmed with the
code sent to it, right in its row. The form offers email only when the
server has SMTP set up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One home for pushing to a user's room: `SocketHandler.emit_to_user`, on a
write-only manager kept per event loop and on the server's own channel.
Streaming's push_to_user and the sync and scan emitters use it too.
- Notifications are stored in one transaction per send, so a broadcast is one
commit, and pushed concurrently. Recipients are resolved from id and
enabled only, and the actor is loaded with just the fields it shows.
- notify_user_or_admins holds the "whoever started it, else the admins"
rule both the scan and the task runner applied by hand.
- A scan notifies from finish(), so no exit path can forget it.
- `data` is never null, dropping its guards; the toast host, the inbox and
the admin form share one tone icon map; the inbox icon uses RAvatar.
- The store keeps its list when a socket echo changes nothing, and small
dead parameters and duplicated lists are gone.
- The socket reconnect after a logout moved from the inbox to AppLayout,
since every v2 feature depends on the socket's identity.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Notifications could only come from backend code, and only in the kinds the
web client knows how to translate. Anyone can now send one that carries its
own text.
- A notification can carry its own title, body, icon and in-app link. RomM's
own kinds stay translated; `custom` and any other kind (`argosy.sync_done`)
is shown with its own content.
- POST /api/notifications: anyone with me.write notifies themselves; an admin
can also notify user ids, `admins` or `all`, and is shown as the sender.
RomM's own kinds are reserved, links must stay inside RomM, and `data` is
capped at 4 KB.
- notify()/notify_admins() accept the same title/body/link/icon.
- Frontend: `snackbar.success(msg, { persist: true })` (or
`{ persist: { body, link } }`) also keeps the message in the inbox. The
first of the request's answer or the socket push shows the toast, so it
appears once.
- Documented in BACKEND_ARCHITECTURE and the backend and frontend skills.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Toasts disappear after a few seconds, and nothing reaches a user who has no
tab open. Notifications are now stored per user and kept until dismissed, so
what a background job or another user did is waiting the next time RomM is
opened.
Backend:
- `notifications` table (0130) with kind, level, data, actor and read_at, capped
at the newest 200 per user.
- /api/notifications: list, mark read, dismiss one, dismiss all.
- notify()/notify_admins() store the row and push `notifications:new` to the
user's socket room; read/dismiss push to the user's other tabs.
- Producers: a scan's end (to whoever started it; an unattended scan tells
the admins when it failed or found new games), a manual task's end (to who
ran it; a scheduled task's failure to the admins), an admin ending someone's
stream, and an admin changing someone's role.
Frontend (v2):
- Unread count badge on the navbar avatar, and a Notifications entry in the
user menu and settings sidebar.
- Notifications view: marks what it shows read, links each row to what it is
about, dismiss one or all.
- Live toast for a new notification, except scans, which already toast.
- The text is rendered from the kind in the reader's language (18 locales).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A filename and a timestamp cannot tell apart a 100% run from a speedrun
seed, so saves and states carry two owner-only annotations: a favorite
heart that sorts them ahead of their band, and a set of free-text labels.
Backend adds `is_favorite` and a JSON `labels` to both tables, with
`PUT /{saves,states}/{id}/{favorite,labels}` mirroring the existing
visibility toggle. Labels are trimmed, de-duplicated case-insensitively
and capped. Both routes write with `touch=False`, so annotating a save
leaves `updated_at` alone: it is not a write to the bytes, and device
sync reads that column to decide staleness.
In v2 the Save data tab grows a heart and a labels button per row, the
labels dialog suggests the labels already used on the ROM, and favorites
lead their slot or core without ever folding the newest version away.
The heart glyph shows only on the launch screens, where the toggle that
would otherwise say it is not there. Phones give the row four bands:
name, labels, facts, buttons.
Closes#942
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
The status poll carries the claim's stamp once the 202 lands, so it can only report this tab's own session and the container it echoed back had nothing left to check.
A playing tab unloads through save-and-exit, which matched on user and platform alone, so a tab that missed its takeover could save and end the claim that replaced it. It now takes the same container and claimed_at as release and resolves its target through the same helper, answering not_found when that claim is gone.
Local checkouts have no release tag, so heartbeat.SYSTEM.VERSION always
falls back to the literal string "development". Add a GIT_BRANCH field
(backend-resolved via git, display-only, not used in the version string
that also feeds outbound User-Agent headers) and use it in the About
dialog and the auth-screen VersionTag so a dev build shows the branch
being worked on instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TDMqXzXexRgC89YxeNjn9q
Play! served PS2 sessions under the raw id "play", since it was missing from
the emulator display names, and the save and state chips showed whatever id
the broker recorded because the names never reached the frontend.
/config now ships the display names, and the chips and core group heads label
an id through them, falling back to the id for one the backend does not name.
The room URL only ever existed in the launch-ready push, so a socket that
dropped while the game was coming up left the tab loading forever over a
session that was running, with no way out but a release.
The session now records the room the launch answered with, the status poll
reports it along with the container it was found on, and a loading tab enters
the stream on that answer.
A drain marker holds a container key with no owner, so a 409 built from it
named no holder and the fleet list showed it as an idle container nobody
could claim.
The claim refusal now reads every pool member, reports the drain, and takes
the holder from a live session. The fleet list reports the drain as its own
state, and the settings panel calls it saving while keeping the desktop shut
until it clears.
The termination notice named only the platform, so a tab could not tell
which of the account's claims had ended. One room carries them all: a
player holding two sessions from a pool, or an admin with a desktop open
alongside a game, tore down the wrong screen.
The notice now names the container it ended and whether that claim was a
desktop. Stream.vue ignores a desktop notice and one for a container it
did not claim; Desktop.vue gains the listener it never had, so a
force-released desktop says so at once instead of at the next heartbeat.
The tombstone also moves ahead of the drain in both teardown paths: the
session is over the moment the marker lands, and a poll during the
seconds of broker round trips that follow found no reason at all.
`GET /api/roms/{id}/files` 500'd on its success path: `RomFileSchema` reads
`is_top_level`, which needs `file.rom`, and `get_rom_file_by_id` only loaded
`track_meta` and `doc_meta`. Validation happens after `begin_session` closes,
so the lazy load raised `DetachedInstanceError`. The parent rom now comes
along in the same load, narrowed to the columns `Rom.full_path` needs.
`last_modified` is nullable in the column but was required in the schema, so
a row added outside a scan validated to nothing. It is now nullable to match,
and the regenerated frontend type follows.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>