shutterbase / shutterbase/shutterbase

Minor backend/wasm hardening (deferred non-blockers from v3 review)

Open
#53 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement nice-to-have
Dominant language
Go
Stars
8
Forks
3
Avg merge
4h 32m
Merged PRs (30d)
8

Description

Small, individually-low-risk items surfaced during the v3 review and accepted as non-blocking. Grouped to avoid issue spam; split out if any one grows teeth.

  • Default-tag first-use racefindOrCreateDefaultTag: concurrent first uploads into a fresh project can race to create the same default tag. Self-heals (unique constraint / next read), but worth a GetOrCreate upsert or advisory lock.
  • Statistics N+1 — the statistics endpoint issues per-entity queries in a loop; fine at current scale, candidate for a single aggregate query if it shows up in latency.
  • Image-create not transactional — record insert + derived work aren't wrapped in one tx; a mid-flight failure can leave partial state. Currently self-correcting on retry; wrap if it ever causes visible inconsistency.
  • WASM error-path memoryui/src/util/fileProcessor.ts retains the original ArrayBuffer on some error paths (known FIXME); release on failure to cap peak memory during large batch uploads.

Filed as a deferred finding from the v3 rewrite review (#44/#45/#46/#47). Non-blocking; tracked for a follow-up.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Choose one deferred item before starting, since this issue groups four separate concerns. Inspect findOrCreateDefaultTag, the statistics endpoint, the image-create flow, or ui/src/util/fileProcessor.ts, depending on the selected scope. Done means addressing the chosen race, query pattern, partial-state risk, or error-path buffer retention without expanding into the other non-blocking findings.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript, wasm
Domain
api, backend, frontend, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.