Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track timezones by name, if possible (Fix #4221) #7399

Closed
wants to merge 8 commits into from

Conversation

pjeby
Copy link
Contributor

@pjeby pjeby commented Apr 9, 2019

closes #4221
Please be sure you are submitting this against the staging branch.

Q A
Bug fix? Yes
New feature? No
Automated tests included? No
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs) #4221
BC breaks? None
Deprecations? None

Description:

Sufficiently-modern browsers support detecting the actual timezone name, not just the offset. This PR checks for this support, and if available, uses it in place of the timezone offset to determine a lead's preferred timezone, thereby fixing #4221.

In the event that the browser doesn't support this feature, a secondary approach is used, based off the algorithm and table used by jstimezonedetect to determine a timezone, taking into account the existence of daylight savings or "summer" time and the direction of change. This approach still has some ambiguity, but only adds a few lines of javascript, vs. including the full 12k of jstimezonedetect, and has much better accuracy than the offset-only method that Mautic used previously. (But if no match is found using the new algorithm, the offset-only method is used as a fallback.)

Steps to reproduce the bug:

  1. Browse to create a new contact from a timezone with DST active (e.g. America/New_York)
  2. The lead in Mautic has the wrong timezone (e.g. America/Halifax)

Steps to test this PR:

  1. Load up this PR
  2. Browse to create a new contact, using any browser
  3. The new contact has the correct timezone (e.g. America/New_York)

List deprecations along with the new alternative:

List backwards compatibility breaks:

@npracht npracht added bug Issues or PR's relating to bugs code-review-needed PR's that require a code review before merging ready-to-test PR's that are ready to test labels Apr 10, 2019
@npracht npracht added this to the 2.15.2 milestone Apr 10, 2019
@npracht npracht added this to Ready to Test (first time) in Mautic 2 Apr 11, 2019
lavita-it
lavita-it previously approved these changes Apr 17, 2019
Mautic 2 automation moved this from Ready to Test (first time) to Changes Requested / Review Apr 17, 2019
@npracht npracht moved this from Changes Requested / Review to Ready to Test (first time) in Mautic 2 Apr 18, 2019
@kuzmany
Copy link
Member

kuzmany commented May 12, 2019

Wasn't double tested before the 2.15.2 PR merge deadline so pushing to the next release.

@kuzmany kuzmany modified the milestones: 2.15.2, 2.16.0 May 12, 2019
@npracht npracht modified the milestone: 2.16.0 Jan 23, 2020
@RCheesley RCheesley added this to the 2.16.1 milestone Mar 9, 2020
@npracht npracht added this to Ready to test in Mautic 2 Mar 10, 2020
@dennisameling dennisameling added the T1 Low difficulty to fix (issue) or test (PR) label Mar 18, 2020
@dennisameling dennisameling removed this from the 2.16.1 milestone Mar 19, 2020
@npracht npracht added Triage M2/M3 and removed code-review-needed PR's that require a code review before merging T1 Low difficulty to fix (issue) or test (PR) ready-to-test PR's that are ready to test labels Apr 4, 2020
@npracht
Copy link
Member

npracht commented Apr 4, 2020

Hi there!
It has been decided to not create any extra Mautic 2 versions (except for major security purpose) knowing that Mautic 3 is coming very soon.

We now want to integrate your contribution in the Mautic 3 roadmap as 3.0.1 candidate.

How to do?

  1. Check if the bug still present in Mautic 3
  2. If Yes: rebase your PR against the 3.x branch
  3. If No: please comment on your PR: “This PR only applies to Mautic 2.x”

Please report results by commenting on your PR to make us administration easier.

In case your bugfix only apply to Mautic 2, we'll consider adding it in an extra Mautic 2 version.


You can more information on how to do all of that on this blog post "Getting you PR ready for Mautic 3".

@npracht
Copy link
Member

npracht commented May 20, 2020

Hello @pjeby could you please test mautic 3.0.0-beta2 and tell me if the issue is still existing?

  • If no, i'll tag this issue at M2 only relevant
  • If yes, could you please rebase your branch against 3.x branch ?

Waiting for your feedback, i would very love to merge it in 3.0.1 if still relevant. Thanks !

@npracht
Copy link
Member

npracht commented Jun 10, 2020

Hi @pjeby would you kindly have a look at conflicts ?
Thanks !

@npracht npracht removed this from Ready to test in Mautic 2 Jun 10, 2020
@npracht npracht added the has-conflicts Pull requests that cannot be merged until conflicts have been resolved label Jun 10, 2020
@RCheesley RCheesley changed the base branch from 3.x to staging June 17, 2020 11:33
@RCheesley
Copy link
Sponsor Member

@pjeby as we haven't heard back on this in the past 6 months and there's an outstanding conflict I'm going to close the PR. If someone would like to pick this up in the future, please create a new PR and reference this one in the description.

@RCheesley RCheesley closed this Sep 19, 2020
@pjeby
Copy link
Contributor Author

pjeby commented Sep 19, 2020

@RCheesley The last two months I've been waiting for a reply from you on #4221, which is the bug this PR fixes. You closed the bug and did not reply to my inquiry as to what fingerprinting has to do with timezone detection. See the discussion here

@kuzmany
Copy link
Member

kuzmany commented Sep 21, 2020

I vote for reopen this PR. It's not related to fingerprint and fix really ugly issue. @pjeby Are you able to resolve conflicts?

@RCheesley
Copy link
Sponsor Member

@pjeby the PR was closed due to a lack of activity despite several requests since April. If you're willing to work on this and resolve the conflicts then we can consider it for inclusion in a future release. Apologies for my misunderstanding on the issue, we were triaging over 500 issues and once or twice I mis-read the threads and made an incorrect assumption.

@RCheesley RCheesley reopened this Sep 21, 2020
@pjeby
Copy link
Contributor Author

pjeby commented Sep 21, 2020

I've just taken a look at the conflicts, and it is not at all clear to me how to proceed. I think you would need to have the person who stripped out the fingerprinting take a look, if you want something done quickly. It will take me a longer time to have the availability to dive into the new code base, since I am now running a private fork due to the extreme delays of getting bug fixes or even the most minor of features merged here.

Speaking of delays, please note that the only action the Mautic team took on this PR for nearly one full year (April 18, 2019 to April 4, 2020) was to tag and retag it and bump it from one milestone to another, when at any time it could've been merged without conflicts. In the meantime, I had a business to run and had to essentially fork Mautic to incorporate a fair number of PRs, including my own, in order to get basic advertised functionality (e.g. timezone detection) to work correctly.

You can probably understand why I would be less than thrilled with the PR being closed for "inactivity" that is nearly three times shorter than the Mautic team's inactivity on the same issue, and also the direct result of that inactivity... and which only needs additional work now because it wasn't merged at any time during the preceding twelve months of inactivity.

@RCheesley
Copy link
Sponsor Member

Hi @pjeby and thanks for getting back to us. We really do appreciate how frustrating it is to make a contribution and have it sit waiting for so long without action being taken. You are not alone in this - we had over 300 open PR's and over 900 open issues to process which had accumulated over years. It sucks that it got this bad, but we are squarely focused on moving forward rather than dwelling on the past.

As you may have noticed we now have an established governance model after extensive community consultation, teams and working groups are coming to life in the community, and we are making a lot of progress in dealing with the vast amount of technical debt that had accumulated.

There are a few cases where we have closed issues and PR's due to inactivity and then re-opened them when the authors have re-emerged. On the whole, most of the ones that have been closed are genuinely inactive. We have to draw the line somewhere, and we felt that we were fair in doing so, giving quite a lot of time for folks to respond before we closed anything down.

It has not been easy with such a small team who are almost exclusively (other than myself) doing this in their spare time alongside full time work and caring responsibilities.

To be clear, this repo is managed by the community, so 'the Mautic Team' you refer to are the product team and release leads, who I can count on one hand. The team was formed in November 2019 after our Community Sprint in Amsterdam where we started to establish the structures from the governance model.

Also, each PR requires testing before it is merged, so we also rely on folk helping us to test the PR's so we can get them into a release. It may be worth thinking about supporting that initiative (testing of PR's) as a business that depends on Mautic, as that is a direct way in which you can help us to get more fixes and features into Mautic and an area in which we are very short of contributors. We have a sprint on the Friday and Saturday before each release freeze which is an ideal time to block out some time if you are able. The next sprints are 16-17 October, following the MautiCon event (17th November), and 18-19 December.

Our biggest factor slowing us down right now is the tiny number of folk who are helping to test, supporting the release process, and generally keeping things moving forward.

A huge amount of work is falling on very few people and we are desperately trying to keep things moving.

So, we totally appreciate the frustration and understand if you do not have the time to address the conflicts, but we simply cannot do anything with your PR until they are addressed. We value any time that folk can contribute to help us get these remaining PR's over the line, or to help in any way with keeping us move forward.

Regarding the fingerprinting being removed, here is the PR that removed the feature: #8428 in case that helps at all. @escopecz may be able to give some guidance as he worked on that PR.

Feel free to reach out to me directly on Slack or by email at ruth.cheesley@acquia.com if you would like to discuss any of the issue above further.

Thanks again for being willing to take a look at the PR - hopefully we will be able to merge it in a future release!

@escopecz
Copy link
Sponsor Member

I would suggest to follow the similar path we did with the getOs() method and do similar thing with the timezone. Basically wrap your JS code to a getTimezone() method and then call it here: https://github.com/mautic/mautic/pull/8428/files#diff-71bea9457a810a06cd4bfce050a010d8R174

I hope it helps.

@cla-bot
Copy link

cla-bot bot commented Sep 30, 2020

Thank you for your contribution! We require all contributors to sign our Contributor License Agreement, and we do not have a record of your signature on file. In order for us to review and merge your code, please head over to https://www.mautic.org/contributor-agreement and complete the form. There may be a short delay while the team add you as a contributor - please be patient :). Any problems contact @RCheesley. CLA has not been signed by @pjeby.

@codecov
Copy link

codecov bot commented Sep 30, 2020

Codecov Report

Merging #7399 (27108e4) into features (c3e2676) will increase coverage by 0.00%.
The diff coverage is 41.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##             features    #7399   +/-   ##
===========================================
  Coverage       39.64%   39.64%           
- Complexity      33978    33984    +6     
===========================================
  Files            1989     1989           
  Lines          105730   105739    +9     
===========================================
+ Hits            41913    41917    +4     
- Misses          63817    63822    +5     
Impacted Files Coverage Δ Complexity Δ
app/bundles/CoreBundle/Helper/DateTimeHelper.php 71.85% <0.00%> (-1.09%) 56.00 <2.00> (+2.00) ⬇️
...les/PageBundle/EventListener/BuildJsSubscriber.php 8.33% <ø> (ø) 14.00 <0.00> (ø)
app/bundles/PageBundle/Model/PageModel.php 36.07% <50.00%> (+0.29%) 167.00 <0.00> (+4.00)

@RCheesley
Copy link
Sponsor Member

@pjeby can you please sign the contributors agreement linked in the post above so we can look at getting this tested and merged?

@cla-bot
Copy link

cla-bot bot commented Dec 14, 2020

Thank you for your contribution! We require all contributors to sign our Contributor License Agreement, and we do not have a record of your signature on file. In order for us to review and merge your code, please head over to https://www.mautic.org/contributor-agreement and complete the form. There may be a short delay while the team add you as a contributor - please be patient :). Any problems contact the Product Team on Slack (get an invite at https://mautic.org/slack). CLA has not been signed by @pjeby.

@RCheesley RCheesley changed the base branch from staging to 3.2 December 14, 2020 12:30
@cla-bot
Copy link

cla-bot bot commented Dec 14, 2020

Thank you for your contribution! We require all contributors to sign our Contributor License Agreement, and we do not have a record of your signature on file. In order for us to review and merge your code, please head over to https://www.mautic.org/contributor-agreement and complete the form. There may be a short delay while the team add you as a contributor - please be patient :). Any problems contact the Product Team on Slack (get an invite at https://mautic.org/slack). CLA has not been signed by @pjeby.

@RCheesley RCheesley changed the base branch from 3.2 to features January 19, 2021 17:19
@npracht
Copy link
Member

npracht commented Jan 20, 2021

Is it doing the same thing as #8205 ?

@pjeby
Copy link
Contributor Author

pjeby commented Jan 21, 2021

After careful review of the CLA, I am going to have to decline. To be clear, I don't have any issue with doing this type of IP assignment for my pull requests.

The issue is that it states that I am assigning the rights in "any original work" I create that is "submitted to us through any manner of communication", which covers an awful lot of things besides pull requests, and seems it could easily be construed to cover almost any IP I put out in the public, or if somebody in your company happens to subscribe to my email list.

So, if at some point there is a more narrowly defined CLA that covers the specific methods of submission, I'd be willing to review it again. But as written, it basically sounds like a blanket grant of any IP I don't specifically keep secret or explicitly disclaim submission of, which is not compatible with my own business.

@cla-bot
Copy link

cla-bot bot commented Mar 26, 2021

Thank you for your contribution! We require all contributors to sign our Contributor License Agreement, and we do not have a record of your signature on file. In order for us to review and merge your code, please head over to https://www.mautic.org/contributor-agreement and complete the form. There may be a short delay while the team add you as a contributor - please be patient :). Any problems contact the Product Team on Slack (get an invite at https://mautic.org/slack). CLA has not been signed by @pjeby.

@npracht npracht closed this May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs has-conflicts Pull requests that cannot be merged until conflicts have been resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong timezone set for countries experiencing DST
7 participants