Skip to content

fix!: Consistent card/cardBefore on CardUpdatedEvent#7156

Open
vdiezel wants to merge 3 commits into
nextcloud:mainfrom
vdiezel:set-cardBefore-on-card-updated-event
Open

fix!: Consistent card/cardBefore on CardUpdatedEvent#7156
vdiezel wants to merge 3 commits into
nextcloud:mainfrom
vdiezel:set-cardBefore-on-card-updated-event

Conversation

@vdiezel

@vdiezel vdiezel commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

Summary

As mentioned in #7147, the CardUpdatedEvent has two problems:

  1. It often doesn't have the cardBefore even if it could
  2. The card it contains is often not the updated version, but still the old one

This makes it difficult for consumers of the event to act upon it.

The CardUpdatedEvent now always has post- and pre-update version of the card. I had to introduce an additional database call in some methods, but they are not ones that are called very frequently, so I think it is fine.

I did check the internal consumers of the CardUpdatedEvent and they should be unaffected. FullTextSearchEventListener relies only on the card ID, which doesn't change, and LiveUpdateListener is only concerned when the boardId of a card changes, which can only happen in the CardService.update which I didn't touch.

I still flagged this as a breaking change because anything outside of the deck app that relies on the inconsistent event might break.

Regarding tests:

I'm not very familiar with phpunit. I was able to add a basic assertion that the CardUpdatedEvent is dispatched and that cardBefore is not null. However I was not able to assert that the cards are actually the cards before and after the update. This involves some interventions at the setters of the Card class that are beyond my skills. If there is a way, you can nudge me towards it and I will happily add the assertions.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

vdiezel added 2 commits August 5, 2025 17:38
Signed-off-by: Viktor Diezel <viktor.diezel@posteo.de>
Signed-off-by: Viktor Diezel <viktor.diezel@posteo.de>
@vdiezel vdiezel changed the title fix!: Set card before on card updated event fix!: Consistent card/cardBefore on CardUpdatedEvent Aug 5, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Signed-off-by: Viktor Diezel <37934155+vdiezel@users.noreply.github.com>
@vdiezel

vdiezel commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

@grnd-alt

Is there anything I can do to get this PR merged? Happy to fix any issues.
We are maintaining a fork of the deck app because we rely on these changes and it would be a big relief to "return home".

@grnd-alt

grnd-alt commented Mar 9, 2026

Copy link
Copy Markdown
Member

@vdiezel tbh I think we can merge this after a rebase to get main back in!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants