fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.36k stars 343 forks source link

Server sending invalid dates #1246

Closed xvasek closed 3 years ago

xvasek commented 3 years ago

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.)

jtojnar commented 3 years ago

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

https://github.com/fossar/selfoss/blob/6fb9a65609dd9f1331f7e3cd6e534a3f937d25a1/assets/js/templates/Item.jsx#L301

and checking what the date is that way?

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

jtojnar commented 3 years ago

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

jtojnar commented 3 years ago

Actually, just dumping the value will probably not give us enough info. I pushed a change that hopefully will: https://github.com/fossar/selfoss/commit/fce8eafc5c050f159109ce58c2d46f3b70795e14

jtojnar commented 3 years ago

The r shortcut should be now fixed at least.

xvasek commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

image

xvasek commented 3 years ago

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 commented 3 years ago

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

xvasek commented 3 years ago

Works perfectly, thx. :-)