Skip to content

Evaluate the CFP period in the conference timezone - #3838

Open
m-altaifi wants to merge 1 commit into
openSUSE:masterfrom
m-altaifi:fix/cfp-conference-timezone
Open

m-altaifi wants to merge 1 commit into
openSUSE:masterfrom
m-altaifi:fix/cfp-conference-timezone

Conversation

@m-altaifi

@m-altaifi m-altaifi commented Sep 1, 2026 •

Copy link
Copy Markdown

Fixes #2769.

Cfp#open? compared the CFP period against Date.current, which resolves in the server timezone rather than the conference's. Cfp#remaining_days had the same defect one step worse — it defaulted to Date.today, which ignores Time.zone entirely.

So for any conference whose timezone differs from the server's, the call for papers opened and closed at the wrong moment. With the server on UTC and the conference in Pacific/Auckland (UTC+12), during the first 12 hours of the 2nd the conference is on the 2nd while the server is still on the 1st, so a CFP starting on the 2nd was still reported closed, and a CFP ending on the 1st stayed open. It opened late and closed late, by the size of the offset. The "N days remaining" counter shown on the CFP pages was off by one over the same window.

Both now resolve today in the conference timezone, via a private conference_today that reuses the Time.find_zone(timezone) idiom already used by Conference#current_conference_day.

I fixed remaining_days alongside open? because it is the same bug reached through a different method — it is displayed next to the CFP state in admin/cfps, conferences/_call_for_* and proposals/_encouragement_text, so leaving it on the server clock would keep showing a counter that disagrees with open?.

Tests

spec/models/cfp_spec.rb gains a context that pins the conference to Pacific/Auckland and freezes the clock at 2026-06-01 23:30 UTC — 11:30 on the 2nd in Auckland — so the server and the conference disagree about the date. It covers both directions: a CFP for the 2nd is open (the server would call it closed), a CFP for the 1st is closed (the server would call it open), and remaining_days counts from the conference's date. All three fail on master.

The existing #open? examples anchored their dates to Date.current while the conference factory assigns a random timezone (Faker::Address.time_zone), so they would have become intermittently flaky once the comparison moved to the conference clock. They now anchor to the same timezone they assert against.

Timecop was already declared in the Gemfile for this purpose but not yet used anywhere.

I do not have a working Ruby/PostgreSQL environment on this machine, so I have not run the suite locally — I am relying on CI here and will follow up on anything it reports.

Cfp#open? compared the CFP period against Date.current and
Cfp#remaining_days defaulted to Date.today, both of which resolve in the
server timezone. A conference in a different timezone therefore opened
and closed its call for papers at the wrong moment: with the server on
UTC and the conference in Pacific/Auckland, a CFP starting on the 2nd
was still reported closed for the first 12 hours of the 2nd, and one
ending on the 1st stayed open for those same 12 hours.

Resolve today in the conference timezone instead, reusing the
Time.find_zone idiom already used by Conference#current_conference_day.
@m-altaifi
m-altaifi force-pushed the fix/cfp-conference-timezone branch from db03230 to 52e9a67 Compare September 1, 2026 22:03

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.

CFP open check should respect conference timezone

1 participant