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

Posts not showing correctly in Week & Day View #450

Open
1 task done
CM707 opened this issue Nov 28, 2024 · 7 comments
Open
1 task done

Posts not showing correctly in Week & Day View #450

CM707 opened this issue Nov 28, 2024 · 7 comments

Comments

@CM707
Copy link

CM707 commented Nov 28, 2024

📜 Description

Scheduled posts not appearing in week calendar view, they are however visible in month view.

Posts are scheduled in Week 49 - on Monday 2/12/2024. Frontend view for week where they're not available is URL is /launches?day=0&week=49&month=10&year=2024&display=week

👟 Reproduction steps

  1. Select Week -> Change to week 49 -> Displays below for Monday 2/12/24
image
  1. Confirm in Month view that the posts are actually scheduled
    image

Edit Post View showing scheduled date/time.
image

👍 Expected behavior

Display scheduled posts under the Week & Day (Displays a day early in the UI) View.

👎 Actual Behavior with Screenshots

Only shows correctly under Month view.

Day View:
image

Week View:
image

Month View:
image

💻 Operating system

Linux

🤖 Node Version

v20.17.0

📃 Provide any additional context for the Bug.

Able to find the post on this API endpoint: /api/posts?display=week&day=0&week=48&month=11&year=2024

Publish Date from API endpoint is "publishDate":"2024-12-01T21:00:00.000Z"
Postiz timezone is set to GMT +10 Brisbane.

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

None

@jamesread
Copy link
Collaborator

Heya, I just tried to reproduce.

I scheduled a post for Thurs 5th, I see it in each calendar mode;

Month:
image

Week:
image

Day;
image

Could you test again and help try and create a reproducer?

@CM707
Copy link
Author

CM707 commented Dec 26, 2024

I can't currently access Postiz to try and replicate this, but I believe it's to do with timezones and only impacts if it's around the 1st of a month. Once I get a chance to sort out why my instance has died after the v1.11.2 update I'll see if I can replicate it again, might be a week or so with the holidays.

@nevo-david
Copy link
Contributor

nevo-david commented Dec 26, 2024 via email

@CM707
Copy link
Author

CM707 commented Dec 26, 2024

We had a small problem with cahcing, mind checking it again?

On Thu, Dec 26, 2024 at 12:51 PM Tate Hill @.> wrote: I can't currently access Postiz to try and replicate this, but I believe it's to do with timezones and only impacts if it's around the 1st of a month. Once I get a chance to sort out why my instance has died after the v1.11.2 update I'll see if I can replicate it again, might be a week or so with the holidays. — Reply to this email directly, view it on GitHub <#450 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX32VBRB4EN4EX37Q4Z4WV32HOKNBAVCNFSM6AAAAABSU4CXDWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRSGE4DINRSGA . You are receiving this because you are subscribed to this thread.Message ID: @.>

Cheers, updated Postiz and confirmed it's up and running again.

Replicated the calendar issue, not 100% sure what a reproducer is though sorry so let me know what other info you require. Unfortunately I haven't had a chance to dig further into it myself so everything below is just best guesses.

I inserted a draft on the 1st Jan 2025 at 4:59am, and can't see it in the January calendar view, but it does show on the December view under the 1st. I suspect it's an issue of the backend using UTC time or something like that and the frontend comparing it against my timezone (Australia/Brisbane - GMT +10)?

image

January Month View:
image

I changed the 4:59am to 11:59am and it shows now in January:
image

The date shown in the docker logs when I enter the 4:59am on 1st Jan is "date": "2024-12-31T18:59:59".

I also notice the 31st Dec doesn't show in the January view despite the days being there, I assume it should be showing though?

Happy to do any further testing or grab any logs, etc. that are required,

@timczm
Copy link

timczm commented Jan 6, 2025

I've reviewed the SQL code on the server (/libraries/nestjs-libraries/src/database/prisma/posts/posts.repository.ts#L69), and I believe the issue arises because the backend is using isoWeek as a filtering condition.

For example, if a post's published time is 2025-01-06 01:00+10:00, its corresponding UTC time would be 2025-01-05 15:00+00:00 (GMT). Under the isoWeek filtering condition, this post would be categorized as belonging to the previous day/week.

This means that for users in the UTC+10:00 timezone, the backend's filtering process, which operates based on UTC+00:00, causes content from the first 10 hours of the week (the first day) to be excluded from that week's view altogether since it's not selected by the SQL query. While the previous week may include results from these posts, they won't be displayed on the frontend because the week view is set to UTC+10:00.

This issue also consistently emerges in the daily view, where only content from 10:00 AM of the current day to 10:00 AM of the following day is displayed. This leads to a kind of disarray in the presentation.

@nevo-david
Copy link
Contributor

@timczm do you think you can solve it?

@timczm
Copy link

timczm commented Jan 7, 2025

@nevo-david I'm unable to start the project on my computer. Specifically, I always get an error when trying to start the backend server. The database services (PostgreSQL, Redis) and the frontend services are running well.

My computer runs on Windows, which might be the reason for the issue.


C:\Users\xx\projects\postiz-app\node_modules@langchain\openai\dist\chat_models.cjs:1109
throw new Error("Azure OpenAI API deployment name not found");
^
Error: Azure OpenAI API deployment name not found
at new ChatOpenAI (C:\Users\xx\projects\postiz-app\node_modules@langchain\openai\dist\chat_models.cjs:1109:23)
at Array. (C:\Users\xx\projects\postiz-app\dist\apps\backend\main.js:20494:15)
at webpack_require (C:\Users\xx\projects\postiz-app\dist\apps\backend\main.js:23181:41)
at Array.Object.defineProperty.value (C:\Users\xx\projects\postiz-app\dist\apps\backend\main.js:19351:31)
at webpack_require (C:\Users\xx\projects\postiz-app\dist\apps\backend\main.js:23181:41)
at Array.Object.defineProperty.value (C:\Users\xx\projects\postiz-app\dist\apps\backend\main.js:16563:28)
at webpack_require (C:\Users\xx\projects\postiz-app\dist\apps\backend\main.js:23181:41)
at Array.Object.defineProperty.value (C:\Users\xx\projects\postiz-app\dist\apps\backend\main.js:64:22)
at webpack_require (C:\Users\xx\projects\postiz-app\dist\apps\backend\main.js:23181:41)
at C:\Users\xx\projects\postiz-app\dist\apps\backend\main.js:23200:22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants