Skip to content

fix: store replica due/wait dates as RFC3339 on create - #663

Open
NaitikVerma6776 wants to merge 1 commit into
CCExtractor:mainfrom
NaitikVerma6776:fix/replica-add-task-rfc3339-dates
Open

NaitikVerma6776 wants to merge 1 commit into
CCExtractor:mainfrom
NaitikVerma6776:fix/replica-add-task-rfc3339-dates

Conversation

@NaitikVerma6776

@NaitikVerma6776 NaitikVerma6776 commented Oct 3, 2026 •

Copy link
Copy Markdown

Summary

  • Format DateTime values as RFC3339 (toUtc().toIso8601String()) in Replica.addTaskToReplica so due/wait survive create
  • Accept Dart's space-separated DateTime.toString() form in Rust parse_datetime as a defensive fallback
  • Add Dart and Rust regression tests for the create-path serialization bug

Fixes #662

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

Test plan

  • Enable TaskChampion replica mode
  • Add a task with Due and Wait dates from the Add Task sheet
  • Confirm both dates are present on the new task after save
  • Confirm edit-path due/wait still works
  • flutter test test/v3/champion/replica_attribute_value_test.dart
  • cargo test dart_datetime_tostring_due_and_wait_are_stored --manifest-path rust/Cargo.toml

Summary by CodeRabbit

  • Bug Fixes
    • Date and time values are now serialized in a consistent UTC format when creating tasks.
    • Task dates using a space-separated timestamp format are now accepted and stored correctly.

Dart DateTime.toString() uses a space, which Rust parse_datetime rejected as None and silently cleared due/wait. Format DateTimes with toIso8601String and accept the space form as a fallback.
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1ada22eb-83d8-43e5-be44-2f428c98a41e
📥 Commits

Reviewing files that changed from the base of the PR and between 90700d4 and 9f82e97.

📒 Files selected for processing (3)
  • lib/app/v3/champion/replica.dart
  • rust/src/api.rs
  • test/v3/champion/replica_attribute_value_test.dart

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

Replica task creation now formats DateTime attributes as UTC ISO 8601 strings. Rust date parsing accepts RFC 3339 timestamps and space-separated timestamps. Tests cover both formatting and stored due and wait values.

Changes

Replica date handling

Layer / File(s) Summary
Date serialization and parsing
lib/app/v3/champion/replica.dart, test/v3/champion/replica_attribute_value_test.dart, rust/src/api.rs
addTaskToReplica uses attributeValueToString to format DateTime values as UTC ISO 8601 strings. Rust parse_datetime trims input, rejects empty strings, and accepts RFC 3339 or space-separated timestamps. Tests cover formatting and stored due and wait timestamps.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: brawlerxull

Merge Risk: ⚪ Minimal · up to 9f82e

Selected due and wait dates follow the replica creation path into stored task values. No actionable merge-blocking risk remains after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 9f82e

The change repairs date preservation without changing task identity, storage ownership or write permissions. No introduced security concern was established. Confidence remains limited by unverified crash recovery and concurrent-write behavior.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated affected scope is task dates in the selected local profile replica, through existing create and edit operations. Task attributes do not select the storage directory in the inspected Dart create path. Remote synchronization exposure was not traced.

Trust Boundaries and Controls

  • observed — User-controlled task fields cross the existing application FFI boundary into read/write task storage. The PR preserves the attribute allowlist, generated task identity and storage selection. The date fallback still passes normalized input through typed parsing rather than interpreting it as commands or paths.

Resilience and Maintainability Implications

  • observed — Creation submits operations before a separate refresh. Normal fetch and decoding failures are caught by refresh and return an empty list. Repeated create calls generate fresh UUIDs without a durable retry key; malformed non-recurring dates can still become absent dates. These behaviors predate the PR, while interruption and concurrent-storage guarantees remain unverified.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the change to store replica due/wait dates as RFC3339 when creating tasks.
Description check ✅ Passed The description summarizes the change, identifies issue #662, and reports regression tests. The documentation checklist item and all test-plan items remain unchecked, and the description does not stat…
Linked Issues check ✅ Passed Issue #662 requires due and wait dates selected during task creation to persist. Replica.attributeValueToString converts DateTime values to UTC ISO 8601 before addTaskToReplica writes them. Rust…
Out of Scope Changes check ✅ Passed All changes address issue #662. The Rust parser fallback and regression tests support the create-path date fix. No unrelated changes appear in the pull request diff.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

Replica add-task silently drops due and wait dates (DateTime.toString is not RFC3339)

1 participant