Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle copy of live photos #42170

Merged
merged 1 commit into from
Mar 8, 2024
Merged

handle copy of live photos #42170

merged 1 commit into from
Mar 8, 2024

Conversation

ArtificialOwl
Copy link
Member

  • uses of handleMove() during the BeforeNodeCopiedEvent to check the doability of copying both files.
  • handleCopy() called during the NodeCopiedEvent to generate a copy of the linked file.

@ArtificialOwl
Copy link
Member Author

/backport to stable28

@skjnldsv skjnldsv added the 2. developing Work in progress label Feb 21, 2024
@ArtificialOwl ArtificialOwl added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 27, 2024
/**
* @since 20.0.0
*/
public function __construct(Node $source, Node $target, private bool &$run) {
Copy link
Member

Choose a reason for hiding this comment

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

storing a reference seems pretty hacky to me and an easy way to introduce weirdness down the line.

I would prefer to pass $run by value and then update $arguments['run'] after the hook is dispatched.
It's more code but the intent is clearer to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

How can the listener gives the new value of $run back to the emitter?

Copy link
Member

Choose a reason for hiding this comment

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

add a getter so HookConnector can retrieve it

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds smart. @ArtificialOwl will you have the time to update the other event listeners too ? :D

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Tested few other ways but the simplest seems to have the HookController catching new event AbortedEventException and update $arguments['run']. Throwing the exception also stop the event propagation.

@icewind1991 @artonge please re-review

@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Mar 7, 2024
@skjnldsv skjnldsv added this to the Nextcloud 30 milestone Mar 7, 2024
@ArtificialOwl
Copy link
Member Author

thanks @icewind1991
fixed last comment, squashed & rebased

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@ArtificialOwl ArtificialOwl merged commit 71fd623 into master Mar 8, 2024
160 checks passed
@ArtificialOwl ArtificialOwl deleted the fix/noid/copy-live-photos branch March 8, 2024 14:51
Copy link

backportbot bot commented Mar 8, 2024

The backport to stable28 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable28
git pull origin stable28

# Create the new backport branch
git checkout -b backport/42170/stable28

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 467c84ec

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/42170/stable28

Error: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@ArtificialOwl
Copy link
Member Author

@artonge based on the size of the changes and the need for this feature, do we want to backport to 28 ?

@artonge
Copy link
Contributor

artonge commented Mar 9, 2024

I would say no, but not for me to decide, @sorbaugh

@Altahrim Altahrim mentioned this pull request Mar 12, 2024
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels Mar 15, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 29 Mar 15, 2024
@squid-f
Copy link

squid-f commented Jun 29, 2024

Hi. Just updated to 29.0.3 and the error persists :
AbortedEventException Cannot delete the video part of a live photo delete process aborted

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 backport-request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants