[#4592] fix(frontend): deployment "Last modified" shows the deployed revision date - #4593
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR fixes deployment "Last modified" display by introducing timestamp precedence logic that prefers deployed revision dates over environment record timestamps. A new ChangesDeployment timestamp precedence
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/packages/agenta-entities/src/environment/state/appDeployments.ts (1)
126-131: 💤 Low valueConsider making variant lookup reactive in a follow-up.
The
getDefaultStore().get(...)call bypasses Jotai's dependency tracking, so if the variants list updates, this value won't re-derive. This is acceptable for a legacy-data fallback, but for consistency with the now-reactive revision resolution, a future refactor could pass variants data similarly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9e9ff6a2-b5b7-498c-a6a6-0bbe0cb2c918
📒 Files selected for processing (2)
web/packages/agenta-entities/src/environment/state/appDeployments.tsweb/packages/agenta-entities/tests/unit/app-deployments.test.ts
Railway Preview Environment
Updated at 2026-06-10T13:52:13.588Z |
What was wrong
On the prompt Overview → Deployment card, Last modified showed the wrong date, usually far in the past, so you could not tell when a prompt was actually deployed. A project whose environments were all created on one day showed that same creation date for every environment's deployment, no matter when each revision was actually deployed.
Cause
The date came from the environment record's own timestamp:
A simple-environment's
updated_at/created_attrack the environment artifact. They do not change when a new revision is deployed, so the displayed date was unrelated to the deploy (usually the environment's creation date).Fix
appEnvironmentsQueryAtomFamilynow resolves the deployed revision reactively from the raw revision query (workflowMolecule.atoms.query(revisionId).data, the same source the Registry "Created on" column uses) and "Last modified" uses that revision's commit date.Precedence (in
resolveDeploymentLastModified):revision.created_at→revision.updated_at→env.updated_at→env.created_at.Two details that matter:
workflowMolecule.get.data(). The latter returns a merged server+draft object whosecreated_atis the artifact's creation date, not the revision's commit date.get(...)inside the derived atom), so the date re-derives when the revision loads instead of reading a stale imperative snapshot.Before / After
Verification
resolveDeploymentLastModified), 6 cases.tsc --noEmitandeslintclean on the changed files.Scope:
@agenta/entitiesonly (two files).Closes #4592