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

Server sending invalid dates #1246

Closed
xvasek opened this issue Feb 16, 2021 · 10 comments
Closed

Server sending invalid dates #1246

xvasek opened this issue Feb 16, 2021 · 10 comments
Labels
Milestone

Comments

@xvasek
Copy link

xvasek commented Feb 16, 2021

Hello,

I have problems with development builds in firefox. If the list of articles is empty, I see the gui, but when there is at least one article, i see only background (in all window sizes):

obrazek

In console I see "invalid date" errors.

obrazek

In Edge selfoss more or less works. (ie. "R" for reload does not work, but I don't know, if it worked before, I only used Edge for test.)

@xvasek xvasek changed the title Snapshot 2.19 does not work in Firefox Snapshot 2.19 - no menu Firefox Feb 16, 2021
@jtojnar jtojnar added the bug label Feb 16, 2021
@jtojnar
Copy link
Member

jtojnar commented Feb 16, 2021

Thanks for reporting.

Could you try dumping the date using the following patch?

diff --git a/assets/js/templates/Item.jsx b/assets/js/templates/Item.jsx
index 275365ae..7c386541 100644
--- a/assets/js/templates/Item.jsx
+++ b/assets/js/templates/Item.jsx
@@ -295,6 +295,8 @@ export default function Item({ item, selected, expanded, setNavExpanded }) {
     const relDate = selfoss.ui.datetimeRelative(item.datetime);
     const shares = selfoss.shares.getAll();
 
+    console.log(item.datetime);
+
     return (
         <div data-entry-id={item.id}
             data-entry-source={item.source}

Or adding debugger breakpoint to the affected line

data-entry-datetime={item.datetime.toISOString()}

and checking what the date is that way?

By the way, which development build do you have? And do you use offline mode?

@jtojnar
Copy link
Member

jtojnar commented Feb 16, 2021

The r is a known regression, just forgot about it. Sorry, will push a fix soon.

jtojnar added a commit that referenced this issue Feb 16, 2021
Date constructor will not fail when invalid date is supplied but it will construct an invalid Date object.
The object will then raise an exception when trying to stringify it.

Let’s fail early instead.

See #1246
@jtojnar
Copy link
Member

jtojnar commented Feb 16, 2021

Actually, just dumping the value will probably not give us enough info. I pushed a change that hopefully will: fce8eaf

@jtojnar jtojnar added this to the 2.19 milestone Feb 16, 2021
jtojnar added a commit that referenced this issue Feb 16, 2021
By switching to route-driven navigation when porting to React, reload action became a no-op.
Let’s fix that by explicitly reseting the EntriesPage state.

Mentioned in #1246
@jtojnar
Copy link
Member

jtojnar commented Feb 16, 2021

The r shortcut should be now fixed at least.

@xvasek
Copy link
Author

xvasek commented Feb 16, 2021

Thank you, I'm confirming "r" now works and navigation panel doesn't disappear when items are in list - so far so good. After loading the page, items are still not displayed and I have redish error message:

Chyba načítání: Invalid date detected: “2021-02-16 22:45:05+01”

The problem IMHO is "+01" in the date, but you are the developer. :-)

@jtojnar
Copy link
Member

jtojnar commented Feb 16, 2021

The +01 is a timezone offset. The issue is that it is missing minutes for some reason (should be +01:00). What PHP version do you use?

@jtojnar
Copy link
Member

jtojnar commented Feb 16, 2021

Could you search for the date in the last XHR response before the error?

image

@xvasek
Copy link
Author

xvasek commented Feb 17, 2021

My installation is Debian 10 Buster and php 7.3.19-1~deb10u1. I'm using postgres 11 (just upgraded from 9.6 now - no change).

In XHR response all datetimes have wrong format - same as above.

obrazek

@jtojnar jtojnar changed the title Snapshot 2.19 - no menu Firefox Server sending invalid dates Feb 17, 2021
@jtojnar
Copy link
Member

jtojnar commented Feb 17, 2021

Thanks again for reporting, I just pushed a fix. It should work with all three supported database engines according to my tests.

@xvasek
Copy link
Author

xvasek commented Feb 17, 2021

Works perfectly, thx. :-)

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

No branches or pull requests

2 participants