Skip to content

A UTC-5 Jira account no longer skips five hours of updates - #1493

Open
0xvectr wants to merge 2 commits into
deeplethe:devfrom
0xvectr:fix/1484-jira-account-time-zone
Open

0xvectr wants to merge 2 commits into
deeplethe:devfrom
0xvectr:fix/1484-jira-account-time-zone

Conversation

@0xvectr

@0xvectr 0xvectr commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

A Jira sync now writes its updated >= bound in the account's timeZone from /rest/api/2/myself (new chrono-tz dep), so a UTC-5 account no longer skips 5 hours; with no readable zone, anonymous included, it uses UTC-12, re-reading up to 26 h. jql takes the zone, not now: an absolute bound depends only on since and zone, so tests stay deterministic.

Closes #1484

Signed-off-by: 0xvectr <57480598+0xvectr@users.noreply.github.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for tracking this down. The authenticated path looks right to me, including the DST overlap handling, and chrono-tz is a reasonable dependency since nothing in the workspace carries a tz database. One thing before merge:

  1. Anonymous sources now always write the bound for UTC-12, so every incremental run re-reads ~26 h of issues in both passes. Since positions includes those already-seen issues, any of them updated between pass 1 and pass 2 fails the run with "changed during pagination"; on a busy anonymous project (e.g. issues.apache.org, which is UTC) that failure becomes much more frequent. Could we avoid the blanket fallback there — an optional time_zone on the source config, or the offset from anonymous /rest/api/2/serverInfo as a best guess — and keep UTC-12 only when nothing is known?
  2. If the wide window stays, could pass 2 leave issues at or before since out of the positions comparison where paging doesn't depend on offsets (Cloud's nextPageToken)?

Jira reads an integer JQL time as an instant for any account, so anonymous sources no longer re-read 26 hours each run.

Signed-off-by: 0xvectr <57480598+0xvectr@users.noreply.github.com>
@0xvectr

0xvectr commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Neither guess holds up: anonymous serverInfo on Cloud reports Etc/UTC while hibernate.atlassian.net reads anonymous JQL at -0800, and Server omits the zone, so the bound is now epoch milliseconds (updated >= 1788093296789), which Jira reads as the same instant for any account on Cloud and Server. That drops myself, chrono-tz and the UTC-12 fallback, so no wide window is left for point 2.

@WaylandYang

Copy link
Copy Markdown
Contributor

Thanks, and sorry this sat for ten days: the epoch-millisecond bound is a cleaner answer than either of my suggestions. It removes the zone question, the 26 h re-read and the chrono-tz dependency. Could you rebase on dev (it conflicts now) and update the PR description, which still describes /myself, chrono-tz and the UTC-12 fallback? I'll re-review right after.

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.

2 participants