Skip to content

Avoid full metadata rewrites for thread timestamp updates - #48983

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/d5bc70d57e591e3eb8e9521f0c31a7ef75f244d3
Sep 28, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/d5bc70d57e591e3eb8e9521f0c31a7ef75f244d3

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Avoid full metadata rewrites for thread timestamp updates

Why

Updates that only change updated_at should not rewrite unrelated thread metadata or its indexes.

What changed

Use touch_thread_updated_at for timestamp-only patches when the SQLite row exists and the rollout path is unchanged. Preserve the full update path for missing rows, changed rollout paths, and patches containing other metadata, including staged changes.

Testing

Add regression coverage for legacy and paginated histories that verifies missing-row reconstruction, timestamp-only writes using SQLite triggers, preservation of other metadata, and application and removal of staged metadata.

## Why

Updates that only change `updated_at` should not rewrite unrelated thread metadata or its indexes.

## What changed

Use `touch_thread_updated_at` for timestamp-only patches when the SQLite row exists and the rollout path is unchanged. Preserve the full update path for missing rows, changed rollout paths, and patches containing other metadata, including staged changes.

## Testing

Add regression coverage for legacy and paginated histories that verifies missing-row reconstruction, timestamp-only writes using SQLite triggers, preservation of other metadata, and application and removal of staged metadata.

GitOrigin-RevId: d5bc70d57e591e3eb8e9521f0c31a7ef75f244d3
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/d5bc70d57e591e3eb8e9521f0c31a7ef75f244d3 branch from 688a21d to c0d2694 Compare September 28, 2026 13:44
@copyberry
copyberry Bot merged commit c0d2694 into main Sep 28, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/d5bc70d57e591e3eb8e9521f0c31a7ef75f244d3 branch September 28, 2026 13:44
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 28, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.