Skip to content

Conversation

@nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Nov 9, 2023

…e same data

Summary

  • Make sure the events in appdata match the ones for normal files
    $node = $this->getNodeForPath($arguments['path']);
    $this->root->emit('\OC\Files', 'postCreate', [$node]);
    $this->dispatcher->dispatch('\OCP\Files::postCreate', new GenericEvent($node));
    $event = new NodeCreatedEvent($node);
  • This was always misaligned, but in 27 etc the event was dispatched with 2 different classes and therefore the type check at
    } else {
    $logger->debug(
    'Cannot handle event {name} of {event} against entity {entity} and operation {operation}',
    [
    'app' => self::APP_ID,
    'name' => $eventName,
    'event' => get_class($event),
    'entity' => $entityClass,
    'operation' => $operationClass,
    ]
    );
    }
    checked a wrong event so it was actually never handled and did not error:
  • So the same event was emitted with 2 different event classes and 2 different sets of parameters.

Checklist

@nickvergessen
Copy link
Member Author

I guess we might want to backport this, but then we also need to backport the transition to OCP\EventDispatcher\GenericEvent to have it half broken

@blizzz blizzz mentioned this pull request Nov 9, 2023
@blizzz blizzz added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 9, 2023
@nickvergessen nickvergessen merged commit 397c969 into master Nov 9, 2023
@nickvergessen nickvergessen deleted the bugfix/noid/fix-emitted-events branch November 9, 2023 21:27
@nickvergessen
Copy link
Member Author

Follow up to backport #41404

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

Labels

4. to release Ready to be released and/or waiting for tests to finish bug feature: filesystem feature: workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OCA\WorkflowEngine\Entity\File::getNode(): Return value must be of type OCP\Files\Node, array returned

5 participants