Skip to content

Conversation

@CarlSchwan
Copy link
Member

  • Resolves: #

Summary

Some apps overwrite this and this breaks them.

TODO

  • ...

Checklist

Some apps overwrite this and this breaks them.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
@CarlSchwan CarlSchwan added this to the Nextcloud 33 milestone Jan 9, 2026
@CarlSchwan CarlSchwan self-assigned this Jan 9, 2026
@CarlSchwan CarlSchwan requested a review from a team as a code owner January 9, 2026 09:20
@CarlSchwan CarlSchwan added the 3. to review Waiting for reviews label Jan 9, 2026
@CarlSchwan CarlSchwan requested review from ArtificialOwl, come-nc, icewind1991 and leftybournes and removed request for a team January 9, 2026 09:20
@nextcloud-bot nextcloud-bot mentioned this pull request Jan 9, 2026
Copy link
Contributor

@kyteinsky kyteinsky left a comment

Choose a reason for hiding this comment

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

no error now 🚀

*/
abstract class Entity {
public int|string|null $id = null;
/** @var int $id */
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure but maybe it makes sense to adjust the the variable doc to /** @var int|string|null $id */ for psalm's indication at other places in the server repo since the other adjustments were made according to that


if ($this->snowflake === null) {
$this->snowflake = Server::get(ISnowflakeDecoder::class)->decode($this->id);
$this->snowflake = Server::get(ISnowflakeDecoder::class)->decode($this->getId());
Copy link
Member

Choose a reason for hiding this comment

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

Should we have an explicit getId() in this entity which has the full return type?

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

It is not just that apps may overwrite it but that they use $ob->id on entities for tables that don't use snowflakes. That creates a "viral" change that all APIs consuming the id need to be adapted or that we have to add checks to make Psalm happy.

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

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants