Page MenuHomePhabricator

Investigate unit tests and logic of Bucket Tests
Closed, ResolvedPublic

Description

Our logs revealed that a "This should never happen" exception was thrown in the ChoiceFactory. Investigate

  • Does the default bucket get a data when the feature toggle object graph is constructed from the campaign configuration?
  • What happens if a URL contains a parameter for an active but expired campaign and the parameter puts the user in the non-default (i.e. invalid) bucket? The expected behavior is to switch the user to the default bucket.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
gabriel-wmde moved this task from Doing to Review on the WMDE-Fundraising-Funban-2018 board.

Result of the investigation: The CampaignBuilder creates the object graph correctly (although there was one missing test). The URL parameter handling works as expected. The Errors came from another source:

Campaign dates built by the CampaignBuilder were always in the UTC time zone (because of the time zone conversion between the time zone from the configuration file). On servers where the default time zone was not UTC, this leads to errors in Campaign::isExpired.

The solution to this problem is introducing the CampaignDate class that enforces a UTC time zone and does time zone conversion when given a string and time zone.

The PR for this solution is here: https://github.com/wmde/FundraisingFrontend/pull/1406 But that should not be merged before 2019-01-02 (because the FUN team is not present at the end of the campaigns, where we could quickly react).

A short-term solution is to extend all the campaigns. PR for that: https://github.com/wmde/FundraisingFrontend/pull/1412

gabriel-wmde claimed this task.