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

Off by one error on recurring days reminder? #64

Closed
joestump opened this issue Nov 10, 2023 · 11 comments
Closed

Off by one error on recurring days reminder? #64

joestump opened this issue Nov 10, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@joestump
Copy link

Description of the bug

When creating recurring reminders on specific days I'm seeing an off-by-one error when selecting days vs. what the reminder dashboard shows on save. If I select "Mo", on save it shows "Sun" after save on the dashboard.

To Reproduce

  • Click "+"
  • Select a date/time for the reminder to start
  • ✔️ Week Days
  • Select "Mo" for the day of the week
  • You will see "Sun" listed on the UI

Expected behaviour

When I select "Mo"

Screenshots

You can see in this screen recording what I'm seeing with the "Test" reminder:

Screen.Recording.2023-11-10.at.2.24.29.PM.mov

Version info

  • OS: macOS
  • Browser: Safari
  • MIND Version: mrcas/mind:latest
  • Python Version: Docker container
@joestump joestump added the bug Something isn't working label Nov 10, 2023
@Casvt Casvt added this to MIND plans Nov 11, 2023
@Casvt Casvt moved this to Handled Soon in MIND plans Nov 11, 2023
@rossman-home
Copy link

rossman-home commented Dec 22, 2023

Can confirm this bug. Having the same problem. Tried to delete the reminder and readd, having the same issue.
image
image

@Casvt
Copy link
Owner

Casvt commented Feb 3, 2024

Do you have your locale settings set up in such way that Sunday is considered the first day of the week? Also, what is the locale you set in the settings of MIND?

@rossman-home
Copy link

Do you have your locale settings set up in such way that Sunday is considered the first day of the week? Also, what is the locale you set in the settings of MIND?

environment variable was correct, but the Mind settings were possibly the issue. I guess either I set it wrong or it defaulted to "en-gb". I updated it to "en-us" I'll test and see if it works for the entire week. Thanks!

@Casvt
Copy link
Owner

Casvt commented Feb 3, 2024

The default is en-GB yes. What I think is happening is that somewhere on your system (os? Browser? Docker?) a locale is used that considers Sunday to be the first day of the week instead of Monday. MIND doesn't handle that and, without getting too technical, that's why the set days are shifted by one; the beginning of the week is also shifted by one day.

@Casvt Casvt moved this from Handled Soon to In Progress in MIND plans Feb 4, 2024
@rossman-home
Copy link

The default is en-GB yes. What I think is happening is that somewhere on your system (os? Browser? Docker?) a locale is used that considers Sunday to be the first day of the week instead of Monday. MIND doesn't handle that and, without getting too technical, that's why the set days are shifted by one; the beginning of the week is also shifted by one day.

I changed the computer Mind is running on to start Monday, deleted DB and spun the container back up, did not fix. I tried Chrome, Opera, Firefox and Edge browsers on Windows after changing the date on my Windows machine and that did not work. I also tried Firefox on the Linux machine. All after removing the Mind container. Any other options I may be missing?

@Casvt
Copy link
Owner

Casvt commented Feb 13, 2024

Any other options I may be missing?

A bug in my software. I'm not sure what's going wrong yet, but it looks like it's a bug in my software then.

@Casvt
Copy link
Owner

Casvt commented Feb 22, 2024

@joestump, @rossman-home, Could one of you do something for me? I want to determine if the problem lays in the frontend or backend.

  1. Open the web-ui and log in.
  2. Press Ctrl + Shift + I to open the developer tab.
  3. Go to the Network tab (top right).
  4. Reload the page.
  5. A list of requests should pop up in the Network tab.
  6. Select the request made to /api/reminders (will look like reminders?api_key=... in the list).
  7. A side window should open when you click on the request, select the tab Preview.
  8. Open the results and in the list, search for a reminder that experiences the bug described in this issue.
  9. Share it's data and on which days it's supposed to trigger.

image

Note: the value of the weekdays key will look different for you than you see in the image, don't worry about that.

In the image you can see that I've opened the red "Test1" reminder in the results in the Preview tab. It says for the weekdays [1, 3] (for you "1,3") and in the UI you can see that it says for the days Tue and Thu (which is correct).

@Casvt
Copy link
Owner

Casvt commented Mar 7, 2024

@joestump @rossman-home please see my previous comment

@jdobbs
Copy link

jdobbs commented Apr 5, 2024

I'm pretty sure I'm having the same issue here. I create a reminder for Monday, April 8, 2024, at 8:00 AM (first screenshot). When I save it, it shows Monday, April 15, 2024, but for each Sunday (second screenshot). The third screenshot is the steps from your request to view the request in the browser.

My PC is on New York time (Eastern), the Docker host (Ubuntu 22.04) is on New York time, and I've set the TZ on the MIND Docker to New York. I verified time zones using a website that shows browser TZ on Ubuntu by running the timedatectl and date commands and within the docker by running "docker exec -it mind date".

I've tried Firefox, Edge, and Chrome, and I've also tried private/incognito tabs in each.

I'm the image: mrcas/mind:latest image.

image

image

image

@jdobbs
Copy link

jdobbs commented Apr 5, 2024

Just as another test, I manually deployed to a Windows host using localhost:8080. I get the same issue: a repeating reminder for Monday, April 8, 2024, at 8:00 AM saves as Monday, April 15, 2024, at 8:00 AM but says Each Sunday.

@Casvt
Copy link
Owner

Casvt commented Apr 6, 2024

Thanks for doing the browser thing. Based on the screenshot, I can say that the wrong weekday is purely in the browser and the actual reminder will run on Monday. On my PC, day 0 converts to Monday, but in your screenshot, day 0 converts to Sunday.

So it's purely the browser converting the day of the week wrong (it sees Sunday as the first day of the week). Probably something with localisation.

And I think I found the problem of the first trigger being one week later.

@Casvt Casvt closed this as completed Jul 14, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in MIND plans Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

4 participants