MIND icon indicating copy to clipboard operation
MIND copied to clipboard

Off by one error on recurring days reminder?

Open joestump opened this issue 1 year ago • 11 comments

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:

https://github.com/Casvt/MIND/assets/37667/e0bae87c-cb7d-4243-afd2-40b79d64bc9c

Version info

  • OS: macOS
  • Browser: Safari
  • MIND Version: mrcas/mind:latest
  • Python Version: Docker container

joestump avatar Nov 10 '23 22:11 joestump

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

rossman-home avatar Dec 22 '23 02:12 rossman-home

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?

Casvt avatar Feb 03 '24 20:02 Casvt

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!

rossman-home avatar Feb 03 '24 20:02 rossman-home

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 avatar Feb 03 '24 21:02 Casvt

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?

rossman-home avatar Feb 13 '24 12:02 rossman-home

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 avatar Feb 13 '24 12:02 Casvt

@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 avatar Feb 22 '24 15:02 Casvt

@joestump @rossman-home please see my previous comment

Casvt avatar Mar 07 '24 13:03 Casvt

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 avatar Apr 05 '24 18:04 jdobbs

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.

jdobbs avatar Apr 05 '24 19:04 jdobbs

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 avatar Apr 06 '24 19:04 Casvt