Skip to content

Recently Updated: ignore price-refresh payloads#33

Merged
fleveque merged 1 commit into
mainfrom
fix/recent-portfolios-material-changes
May 21, 2026
Merged

Recently Updated: ignore price-refresh payloads#33
fleveque merged 1 commit into
mainfrom
fix/recent-portfolios-material-changes

Conversation

@fleveque

Copy link
Copy Markdown
Owner

The Recently Updated list looked useless because every dashboard appeared updated at the same time — that's Quantic's periodic stock-price refresh firing `update_holdings` on every worker, which we were stamping as a fresh `updated_at`.

Now compute a holdings signature `(symbol, quantity, avg_price)` and only bump the timestamp when that materially changes. Price-only payloads (new `price` / `value_in_base` / `value_in_usd`, same user-controlled fields) preserve the previous timestamp. The restore path still overrides via `__updated_at` to keep the historical timestamp across server restarts.

Test plan

  • `mix test` — 37 examples, 0 failures (+4 new: price-only no-bump, add holding bumps, edit qty bumps, override preserves)
  • `mix format`, `mix compile` clean
  • Manual: trigger a Quantic stock refresh — confirm Recently Updated timestamps don't all jump to the same minute
  • Manual: edit a holding in Quantic — confirm that portfolio jumps to the top with a fresh timestamp

The Recently Updated list looked useless because every dashboard
appeared updated at the same time — that's because Quantic's
periodic stock-price refresh fires update_holdings on every worker,
and we were stamping updated_at on every payload.

Now compute a holdings signature (symbol, quantity, avg_price) and
only bump the timestamp when that materially changes. Price-only
payloads — which carry new price / value_in_base / value_in_usd but
the same user-controlled fields — preserve the previous timestamp.

The restore path still overrides via `__updated_at` to keep the
historical timestamp across server restarts.

37 tests / 0 failures (+4 new on the worker spec covering
price-only, adding, quantity edit, and override preservation).
@fleveque fleveque merged commit bd0b895 into main May 21, 2026
1 check passed
@fleveque fleveque deleted the fix/recent-portfolios-material-changes branch May 21, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant