fix: add missing entity id in FsEventMapper::getFromQueue()#196
Conversation
The FileSystemListener background job tries to delete events from the queue if the home-dir of the user cannot be found (e.g. because the user account has been removed): https://github.com/rotdrop/nextcloud-app-context-chat/blob/f8566e58d3a384d67615163ef0ac4cf13f276746/lib/BackgroundJobs/FileSystemListenerJob.php#L104 However, this call to `FsEventMapper::delete()` cannot succeed if the entity id is missing, as is currently the case because ATM `FsEventMapper::getFromQueue()` omits the id in its result "entities" (which are in fact then only partial entities). Another way to fix this would be to use `FsEventMapper::deleteByContent()` instead. Signed-off-by: Claus-Justus Heine <himself@claus-justus-heine.de>
|
Wow, really nice catch! Thank you for debugging this and providing a fix! |
|
thanks a lot! |
|
hi @rotdrop |
|
Hello there, 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.) |
Yes please, himself@claus-justus-heine.de. Kind thanks! |
The FileSystemListener background job tries to delete events from the queue if the home-dir of the user cannot be found (e.g. because the user account has been removed):
context_chat/lib/BackgroundJobs/FileSystemListenerJob.php
Line 104 in f8566e5
However, this call to
FsEventMapper::delete()cannot succeed if the entity id is missing, as is currently the case because ATMFsEventMapper::getFromQueue()omits the id in its result "entities" (which are in fact then only partial entities).Another way to fix this would be to use
FsEventMapper::deleteByContent()instead.I stumbled over this cause of errors in the NC log like
with stack trace back to
As such this is just ok and the effect of trying to access the home-directory of a no-longer existing user, but those messages do not go away, they appear over and over again because that delete attempt from
context_chat/lib/BackgroundJobs/FileSystemListenerJob.php
Line 104 in f8566e5
fails as the data returned by
FsEventMapper::getFromQueue()does not include the entity id.