Repository navigation
Conversation
22 tasks
Collaborator
Author
|
Review (REVIEW-5270) on e07592a: MERGE (Lows to fold)
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3549
Part of #3517
Stage 32d4: the TickTick importer, ported from Electron. Stacked on #5241 (
feat/3549-d3-todoist).What it ports (Electron on origin/main)
packages/importers/src/ticktick/parse-csv.ts:71parseTickTickCsv->import/ticktick.rs(streaming reader: preamble rows skipped untilFolder Name, first header wins, empty rows dropped).packages/importers/src/ticktick/map-rows.ts:39mapRows->ticktick/map.rs(lists, kanban statuses, the"{list} {column}"key collision kept, parents, positions per (project, status)).packages/importers/src/ticktick/dates.ts:20splitDateTime->ticktick/dates.rs;duration.ts:4parseIsoDurationMs->dates.rs::duration_ms.rrule.ts:21->ticktick/rrule.rs;priority.ts:7->map.rs; the BigInt order key ->ticktick/order.rs.apps/desktop/src/main/import/ticktick/apply-plan.ts:72applyPlan->ticktick.rs::apply;ticktick-importer.ts:55,94preview and run ->TickTickImporter.create_status_project,project_statuses,create_ticktick_task,create_reminder;complete_task,archive_task,inbox_project_idreused.ticktick(import-section.tsx,import-source-icon.tsx,import-message.tskeys), and the registry entry is the only Rust hook, as for Todoist.pnpm ipc:generateproduced no diff.Interfaces used from #5241:
import::csv_lex::{lex, step, steps},MAX_PLANNED_BYTES,todoist::{parse_int, json_number}(nowpub(super)).This round (on top of the WIP commit 3e8c8b4)
dates.rspanicked (Timestamp::from_millisecond(..).expect) for any instant past about year 9000.JIFF_SAFE_MSwas 9,000 years from 1970, outside jiff's -9999..9999. Now 7,900 years; the 400-year cycle shift lands inside. Three tests went red with the panic before the fix.rowhelper) and run: 32 TickTick tests.Factoryspecial case removed: jiff readsFactoryas UTC, which is Electron's fallback after ICU throws (oracle: 08:00 for 08:00Z), so the branch changed nothing.+100000-01-01NY 07:00 (EST),+250000-03-12NY 08:00 (DST start day),+012345-11-05London 05:30.a_non_ascii_file_name_is_the_preview_labelwritesKi\u{15f}isel.CSVat runtime (from the WIP; now runs green).Parity proof (Electron's own code as oracle)
/tmp/d4/oracle.mtsruns origin/main'sparseTickTickCsv+mapRows+applyPlanwith a recording sink. The same CSVs ran throughTickTickImporter(temporary dump test, not committed). Ops, preview counts and warnings were compared after dropping nulls.Invalid time valueUS/Pacific-New)2020-05-07 08:00)The hand-reasoned expectations the handoff flagged all match Electron: priorities
[0,1,2,3,0,3,2,0,0,1,0]and the1e20warning,-100000NY LMT07:03,+100000NY DST08:00, legacy localMay 7 2020 08:00->12:00UTC in New York.Guards shown red without the guard (production code broken, test counters untouched)
charge(cost * 0)an_export_past_the_budget_fails_and_writes_none_of_its_tasksapplyif false && ctx.is_cancelled()a_cancel_after_the_first_task_creates_no_morerows_of_list)reading_takes_steps_linear_in_the_export: input 2, 2,501,389,346 steps vs bound 4,017,393before)aftera_time_without_a_zone_is_local_with_the_offset_before_a_gap_or_foldThe header bitmask is not a complexity guard: a header has 19 known columns, and a
containsscan short-circuits at the first match, so no input makes it quadratic. The steps test's input 1 (50,000 duplicateTitlecolumns) stayed green with the scan, as expected.Proof (local)
cargo test -p memry-desktop --test integration importer_ticktickcargo test -p memry-desktop --test integration importer(all importers)cargo test -p memry-desktop --test integration article/extract(sharedutils/date.rs)cargo check -p memry-desktop --testscargo clippy -p memry-desktop --all-targets -- -D warnings;cargo clippy --workspace --tests -- -D warningscargo fmt --all --check,node scripts/check-line-ceilings.mjspnpm ipc:generatethenpnpm ipc:checkpnpm lint,pnpm typecheck,pnpm format:check,git diff --checkNo TS changed, so no vitest file was run.
jiffdependency (Kaan is asked separately)The handoff planned
chrono-tz; the WIP usedjiff0.2.38 (std,tz-system,tzdb-bundle-always). Bothjiffandjiff-tzdbwere already inCargo.lock(optional deps ofserde_withandjiff-tzdb-platform), so the lock diff is two dependency lines and no new package.chrono-tzis not in the lock. Electron's results need a tzdb with the full history and the rules past 2037: local mean time before a zone's first rule (1800-01-01Istanbul01:55,-100000NY07:03), DST far in the future, and V8's "offset before the transition" in a gap or a fold, which jiff'sAmbiguousOffset::{Gap,Fold}.beforegives directly. All matched the oracle above.Departures
MAX_PLANNED_BYTESbudget across the run; a file past it fails before any write with "The picked TickTick files hold more tasks than one import can take…".Created Timeis dropped because Electron never passed it tocreateTask.row, as in feat(desktop): Raindrop importer with conformance vectors (32d2) #5214 and feat(desktop): port the Todoist importer (32d3) #5241.Errfromcreate_status_projectis handled as Electron'ssuccess:false: that list's tasks are skipped with "no project" (an Electron throw aborted the whole run). Acreate_reminderErris logged (Electron pushed a warning nobody read).sortcannot panic.US/Pacific-New) fall back to UTC (Electron: PDT). The tzdb version is jiff-tzdb's.Date.parsecoverage is the shared port's: V8 legacy forms it does not parse (2020-05-07 08:00) give no date (Electron read it as local time). TickTick exports write ISO instants with an offset.Known limits
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.