Freshrss: [fever-api] mixed string and number in time

Created on 2 May 2020  路  34Comments  路  Source: FreshRSS/FreshRSS

now the exact opposite to #2934 :
when looking at https://feedafever.com/api the returned last_refreshed_on_time should always be a number. FreshRSS-Fever is always returning a String.

API

All 34 comments

Thanks @Stunkymonkey
Could you please try https://github.com/FreshRSS/FreshRSS/pull/2944 ?

By the way, if you are working on a client and/or are familiar with other clients, please have a look at this table https://github.com/FreshRSS/FreshRSS/pull/2942

@Alkarex is am one of the news_flash guys. I implemented the fever api (and now i am working on google_reader).
news_flash is the rewrite of the Feedreader in rust.

will test it later this evening

That's great, @Stunkymonkey 馃憤
Cross-link for news_flash https://gitlab.com/news-flash/news_flash_base/-/merge_requests/7

I am happy to help with the synchronisation strategy for Google Reader API, so feel free to ask for any sparing.

I am still getting a string on master branch

Sorry @Stunkymonkey , please try again on master

the last_refreshed_on_time is fine.
but other things broken.
when requesting groups. this is the response:

{
  "api_version": 3,
  "auth": 1,
  "last_refreshed_on_time": 1588444229,
  "groups": [
    {
      "id": "1",
      "title": "Uncategorized"
    }
  ],
  "feeds_groups": [
    {
      "group_id": 1,
      "feed_ids": "1"
    }
  ]
}

the first id is supposed to be a number and not a string.

more or less all ids are strings now

but remember feed_ids is a comma seperated string

https://github.com/FreshRSS/FreshRSS/pull/2946
Can you test a PR or should I merge in master?

wait a sec

much better yes.

when getting items
item-&feed-ids are still strings

marking an item read is currently also broken. maybe thats a problem of the test installation.
EDIT: no my test is depending on getting items which relates to previous comment.

when getting items the id of an item still a string

That one I am not sure we should change, as it is a 64-bit ID, which would fail on 32-bit platforms. What do you think?

I am considering adding a new 32-bit ID column for better compatibility with Fever API and if we should add TT-RSS API https://github.com/FreshRSS/FreshRSS/pull/1526 but for now our article IDs are 64-bit

the interesting part before these PRs it was a number anyway
in the docs it is stated:
"id (positive integer)"

We can go for an integer but then have to drop 32-bit support for Fever

32bit support was never there. i started implementing it and it was always returning a number.
in my implementation:
https://gitlab.com/news-flash/fever_api/-/blob/master/src/models/item.rs#L9
which corresponds to a u64. (note: no commits in the last days)

if you want
we can add it and i will parse it to an u64

I am surprised, as I have not changed the type for item ID. Can you double-check with an older commit on master?

Yes, it would be nice to parse the string, because moving to native int64 on FreshRSS side would be a big breaking change at the moment, meaning e.g. no Fever support on typical Rasbperry Pi (i.e. using Raspbian)

Maybe you could test type for that specific field? All others are 32-bit friendly and thus not a problem to publish as native int32

I am surprised, as I have not changed the type for item ID. Can you double-check with an older commit on master?

checked it with the latest release version. Still a number...

Could you please post a snippet of what you got with 1.16.0?

It might be due to which platform I test on (currently a 32-bit Raspberry Pi). Snippet from 1.16.0:

{
      "id": "1336994640387480",
      "feed_id": "85",
      "title": "Premiers pique-niques",
      "author": "Sissi",
      "html": "<p>...</p>",
      "url": "http://...",
      "is_saved": 0,
      "is_read": 1,
      "created_on_time": 1336994640
    }

Indeed, because the type is not consistent from a 32-bit (string) and from a 64-bit (integer) platforms at the moment. I would like to cast it to string to have the same everywhere, if that works for you

we could do that yes

Done

one last thing. sorry for the long discussion.
when getting items there is
"total_items": 4513,
which is in #2945 still a string, what I expect and is defined as a number.

I have already implemented to be able to parse string and numbers.

everything works :+1:

Hooray :-)

Was this page helpful?
0 / 5 - 0 ratings