Skip to content

Backport credential activity history to v0.21.4 - #533

Merged
VanshKhanna merged 7 commits into
codex/backport-base-v0.21.4from
codex/activity-backport-sqlite-isolation
Sep 10, 2026
Merged

Backport credential activity history to v0.21.4#533
VanshKhanna merged 7 commits into
codex/backport-base-v0.21.4from
codex/activity-backport-sqlite-isolation

Conversation

@VanshKhanna

@VanshKhanna VanshKhanna commented Sep 10, 2026

Copy link
Copy Markdown

Backport James's credential activity history (#481) and the #506 follow-up to v0.21.4 so host apps can record and display credential activity without adopting the other 0.22.0 changes.

Base: codex/backport-base-v0.21.4, pinned to the v0.21.4 release commit f0e3795d31985b839d372fbd19a6f92b7bda6a0d.

Changes

The SQLite engine, linkage, encryption open sequence, dependency lockfile, workspace manifest, and toolchain pins remain those of v0.21.4. The native SQLite isolation fix is in the independent PR #535, also based directly on v0.21.4; it is not part of this PR.

Validation

  • cargo test -p walletkit-core --lib storage:: --locked: 64 passed, including activity recording/pagination/listeners, migration onto an existing cache, and history preservation across reopen and disposable-cache reset.
  • cargo fmt --all -- --check and git diff --check: pass.
  • Verified that the activity implementation matches the backported commits apart from the imports required by the v0.21.4 crate layout, and that SQLite build/FFI/cipher code, CI workflow, dependency lockfile, workspace manifest, and toolchain pins match v0.21.4.

Tests ran in a separate Git worktree with Rust 1.94.1 and the checksum-verified Nargo version pinned in nix/nargo.nix. Cross-platform CI and host-app activity/persistence validation remain pending. Assign a distinct reviewed backport version before publishing artifacts; source versions still identify v0.21.4.

ketzusaka and others added 7 commits September 10, 2026 14:17
Introduces a sharable on-device store for Android and iOS to retain credential activity. We're re-using some components from the Wallet storage here, while maintaining a separate database for the local activity as it is a separate concern and should never be backed up with the existing systems.

I've modeled the changes after how I typically use rust; mod.rs is mainly imports with most of the code in dedicated files, and tests in their related files.

This system is expected to evolve over time so i've prioritized a sensible migration strategy as part of these changes.

Tested integration on iOS. Will do Android later and follow up with any PRs that might be necessary for their integration. No runtime differences until the host apps are updated to use the new system.
* Introduce Credential Activity History Store

Introduces a sharable on-device store for Android and iOS to retain credential activity. We're re-using some components from the Wallet storage here, while maintaining a separate database for the local activity as it is a separate concern and should never be backed up with the existing systems.

I've modeled the changes after how I typically use rust; mod.rs is mainly imports with most of the code in dedicated files, and tests in their related files.

This system is expected to evolve over time so i've prioritized a sensible migration strategy as part of these changes.

Tested integration on iOS. Will do Android later and follow up with any PRs that might be necessary for their integration. No runtime differences until the host apps are updated to use the new system.

* feaat: minor improvements to activity history

* feaat: minor improvements to activity history

* Update schema.rs

---------

Co-authored-by: James Michael <ketzu@me.com>
@VanshKhanna VanshKhanna changed the title Backport credential activity history and SQLite isolation to v0.21.4 Backport credential activity history to v0.21.4 Sep 10, 2026
@VanshKhanna
VanshKhanna marked this pull request as ready for review September 10, 2026 22:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T22:54:59.471569Z afc510a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: afc510a497

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


pub(super) fn ensure_activity_schema(conn: &Connection) -> DbResult<()> {
conn.execute_batch(
"CREATE TABLE IF NOT EXISTS activity_entries (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Move activity history out of the disposable cache

Creating activity_entries in CacheDb makes user-visible history subject to the existing cache/maintenance.rs::open_or_rebuild policy, which deletes the entire cache database and its sidecars after any open, key, or integrity failure. In that scenario every activity entry is silently lost; the added schema-version-reset test does not exercise this deletion path. Store this credential-specific history in the authoritative credential vault instead.

AGENTS.md reference: AGENTS.md:L12-L12

Useful? React with 👍 / 👎.

fn encode_issuer_schema_ids(issuer_schema_ids: &[u64]) -> Vec<u8> {
let mut bytes = Vec::with_capacity(issuer_schema_ids.len() * 8);
for id in issuer_schema_ids {
bytes.extend_from_slice(&id.to_be_bytes());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Freeze the issuer-schema ID encoding in a byte-level test

This big-endian concatenation becomes a persisted database format, but the added tests only write and read through the same implementation and merely check the decoded vector length. A future simultaneous encoder/decoder change would therefore pass while making existing activity rows decode incorrectly; add a fixture asserting the exact bytes for representative IDs next to this code.

AGENTS.md reference: AGENTS.md:L9-L9

Useful? React with 👍 / 👎.

@murph murph left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rubber stamp backport

@VanshKhanna
VanshKhanna merged commit 7267038 into codex/backport-base-v0.21.4 Sep 10, 2026
20 checks passed
@VanshKhanna
VanshKhanna deleted the codex/activity-backport-sqlite-isolation branch September 10, 2026 23:23
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.

4 participants