Replica add-task silently drops due and wait dates (DateTime.toString is not RFC3339)
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend-api-design, mobile-dev
Hướng nghiên cứu
Start with AddTaskBottomSheet.onSaveButtonClickedForReplica in lib/app/modules/home/views/add_task_bottom_sheet_new.dart and Replica.addTaskToReplica in lib/app/v3/champion/replica.dart, then inspect parse_datetime in rust/src/api.rs. Run the relevant Dart and Rust tests available in the repository; done means replica-created tasks retain the selected due and wait timestamps in RFC3339-compatible form.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
On the TaskChampion / replica path, creating a task with a due or wait date from the Add Task sheet reports success, but the date is not stored.
The add sheet puts a Dart DateTime into the replica map. Replica.addTaskToReplica then calls .toString() on that value. Dart’s DateTime.toString() uses a space (2026-10-03 12:00:00.000Z). The Rust FFI parse_datetime only accepts RFC3339 (2026-10-03T12:00:00.000Z). Parse failure becomes None, and set_due / set_wait clear the field. The write still succeeds, so the UI shows “task added”.
The edit path already formats with toIso8601String() (which includes T), so dates set on the detail screen survive. Only create is wrong.
This is source-confirmed on main (90700d4). I could not run the Flutter app in this environment (no Flutter SDK).
Steps to reproduce
- Enable TaskChampion replica mode (
settings_taskr_repl). - Open Add Task.
- Enter a description and pick a Due (and/or Wait) date/time.
- Save. Confirm the success snackbar.
- Open the new task (or list it after refresh).
Expected behavior
The due/wait timestamp chosen in the add sheet is stored on the replica task, same as when the same date is set later on the edit screen.
Actual behavior
The task is created without due / wait. The add sheet still reports success.
Technical analysis
Create path
AddTaskBottomSheet.onSaveButtonClickedForReplica (lib/app/modules/home/views/add_task_bottom_sheet_new.dart) passes:
due: getDueDate(homeController.selectedDates)?.toUtc(),
wait: getWaitDate(homeController.selectedDates)?.toUtc(),
Replica.addTaskToReplica (lib/app/v3/champion/replica.dart) stringifies every attribute with:
map[attr] = newTask[attr].toString();
For a UTC DateTime that is 2026-10-03 12:00:00.000Z (space, not T).
FFI
parse_datetime in rust/src/api.rs:
fn parse_datetime(input: &str) -> Option<DateTime<Utc>> {
if input.trim().is_empty() {
return None;
}
input.parse::<DateTime<Utc>>().ok()
}
Empty or unparsable input → None. add_task then does t.set_due(parse_datetime(&value), …) with no error if parse fails. Rust unit fixtures correctly use 2026-09-01T09:00:00Z(withT`), so they never catch this.
Edit path (works)
TaskcDetailsController.saveTask converts with parsed.toUtc().toIso8601String() before modifyTaskInReplica. That string still goes through .toString(), but it is already RFC3339.
Impact
Users on the replica / TaskChampion path (the GSoC v3 default) lose due and wait dates at creation. Overdue highlighting, wait filtering, and sync to other Taskwarrior clients all miss those dates until the user re-enters them on the detail screen. The success snackbar hides the failure.
Possible fix
- In
addTaskToReplica(and anywhere else aDateTimeis put on the map), sendtoUtc().toIso8601String()instead oftoString(). - Optionally make
parse_datetimereject unparsable non-empty strings instead of treating them as “no date”, so a bad format cannot succeed silently. - Add a regression: add a replica task with a due string in Dart
DateTime.toString()form and assert it is stored (or that the write is refused).
Environment
- Repository: CCExtractor/taskwarrior-flutter
- Branch: main (
90700d4f08a58bcaf7e5804352a7bd565ed7ddd8) - App version in pubspec: 3.0.0+3
- Dart SDK constraint:
>=3.0.5 <4.0.0 - TaskChampion FFI:
rust/src/api.rs(taskchampion2.0.3) - Flutter app not run locally (SDK not on PATH)
- Ngôn ngữ chính
- Dart
- Star
- 244
- Fork
- 180
- Merge trung bình
- 20 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CCExtractor/taskwarrior-flutter
-
Fix misaligned text "Select the directory" in settings tileCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CCExtractor/taskwarrior-flutter#639 · 2 bình luận ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Drawer should close automatically when navigating to a new screenCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Sensitive Credentials Stored in Plain Text Files Without EncryptionCó thể làm lại được @sahu-virendra-1908 đã nhận 191 ngày trước và không có pull request nào đang mở. Đang mởbug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
CCExtractor/taskwarrior-flutter#645 · 1 bình luận ·
-
Data Inconsistency When Editing Task (Missing Transaction)Có thể làm lại được @aryanorastar đã nhận 51 ngày trước và không có pull request nào đang mở. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
CCExtractor/taskwarrior-flutter#643 · 1 bình luận ·
Tất cả issue của CCExtractor/taskwarrior-flutter
Issue tương tự
-
area: ui enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: web server enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Android build configĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
mill-road-winter-fair/mill_road_winter_fair_app#549 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Bug: Android bottom bar opens over tab bar in fullscreenCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
theoden8/webspace_app#672 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
aaronified/fluenough#300 ·
Maintainer thường phản hồi trong vòng 1 ngày