Skip to content

Consistent entry ID type (32-bit compatibility)#5213

Merged
Alkarex merged 10 commits intoFreshRSS:edgefrom
Alkarex:consistent-entry-id
Mar 22, 2023
Merged

Consistent entry ID type (32-bit compatibility)#5213
Alkarex merged 10 commits intoFreshRSS:edgefrom
Alkarex:consistent-entry-id

Conversation

@Alkarex
Copy link
Member

@Alkarex Alkarex commented Mar 19, 2023

Entry IDs (which are 64-bit integers) must be processed as string to be compatible with 32-bit platforms.
In some previous type hints PR, this was a bit messed with.
(NB: Category / Feed / Tag IDs are 32-bit integers, so they can be passed as int without problem)

#5212 must be merged first.

P.S. The last commits add PHPStan level 6 for affected files

vendor/bin/phpstan analyse --level 6 app/Models/EntryDAO.php app/Models/EntryDAOPGSQL.php app/Models/EntryDAOSQLite.php

Alkarex added 5 commits March 18, 2023 22:17
The interface was not used, and it was preventing more precise types for the different `searchById()` methods, as they each have different input and output types.
Entry IDs (which are 64-bit integers) must be processed as string to be compatible with 32-bit platforms
@Alkarex Alkarex added this to the 1.22.0 milestone Mar 19, 2023
@Alkarex Alkarex added API 🤝 API for other clients System care Everything related to system care labels Mar 19, 2023
@Alkarex Alkarex changed the title Consistent entry ID (32-bit compatibility) Consistent entry ID type (32-bit compatibility) Mar 19, 2023
* @return integer|false
*/
private function setItemAsRead(int $id) {
private function setItemAsRead(string $id) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example, which was breaking 32-bit compatibility

* there is an other way to do that.
*
* @param integer|array $ids
* @param string|array<string> $ids
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example of wrong type hint, breaking 32-bit compatibility

@Alkarex Alkarex merged commit e750448 into FreshRSS:edge Mar 22, 2023
@Alkarex Alkarex deleted the consistent-entry-id branch March 22, 2023 08:57
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Jan 18, 2024
Alkarex added a commit that referenced this pull request Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API 🤝 API for other clients System care Everything related to system care

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants