Skip to content

fix: expect interface, not a specific implementation - #38625

Merged
blizzz merged 5 commits into
masterfrom
fix/noid/querysearchehelper-narrow-type
Jun 23, 2023
Merged

fix: expect interface, not a specific implementation#38625
blizzz merged 5 commits into
masterfrom
fix/noid/querysearchehelper-narrow-type

Conversation

@blizzz

@blizzzblizzz commented Jun 2, 2023

Copy link
Copy Markdown
Member

Summary

  • fixes a regression when deleting folders while music app was enabled, for a LazyRoot was passed to this method.

Checklist

@blizzzblizzz added this to the Nextcloud 28 milestone Jun 2, 2023
@blizzz
blizzz requested review from a team, ArtificialOwl, icewind1991 and nfebe and removed request for a teamJune 2, 2023 23:22
@szaimenszaimen closed this Jun 4, 2023
@szaimenszaimen reopened this Jun 4, 2023
@blizzz
blizzz requested a review from come-ncJune 8, 2023 20:56
Comment threadlib/private/Files/Node/Node.php Fixed
@blizzz
blizzzforce-pushed the fix/noid/querysearchehelper-narrow-type branch from 1acc054 to a38b21cCompareJune 10, 2023 18:20
Comment threadlib/private/Files/Cache/QuerySearchHelper.php Outdated
Comment threadlib/private/Files/Node/Root.php Outdated
Comment threadlib/private/Files/FileInfo.php Outdated
Comment threadlib/private/Files/Cache/QuerySearchHelper.php Outdated
@szaimenszaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jun 14, 2023
@JoshuaPettus

Copy link
Copy Markdown

Why is this slated for NC28? It's a regression that effects NC26 and 27.

@paulijar

Copy link
Copy Markdown
Contributor

It's a regression that effects NC26 and 27.

And also NC25.

@blizzz

blizzz commented Jun 15, 2023

Copy link
Copy Markdown
MemberAuthor

Why is this slated for NC28? It's a regression that effects NC26 and 27.

For this PR is against the master branch. Backports would have the specific milestone of the next maintenance release assigned.

@blizzz
blizzzforce-pushed the fix/noid/querysearchehelper-narrow-type branch from a38b21c to ff23772CompareJune 15, 2023 21:34
Comment threadlib/private/Files/Node/LazyFolder.php Fixed
@blizzz
blizzzforce-pushed the fix/noid/querysearchehelper-narrow-type branch from ff23772 to cde9c1dCompareJune 15, 2023 21:42
@blizzz

blizzz commented Jun 15, 2023

Copy link
Copy Markdown
MemberAuthor
ERROR: UndefinedInterfaceMethod - lib/private/Files/Node/Folder.php:347:24 - Method OCP\Files\IRootFolder::createNode does not exist (see https://psalm.dev/181)
return [$this->root->createNode(

Wow, how did this even work, ever? createNode is protected.

To answer the question myself:

Objects of the same type will have access to each others private and protected members even though they are not the same instances. This is because the implementation specific details are already known when inside those objects.

phpdoc

@blizzzblizzz removed the 2. developing Work in progress label Jun 16, 2023
@blizzzblizzz added the 3. to review Waiting for reviews label Jun 16, 2023
@blizzz
blizzz requested a review from come-ncJune 16, 2023 22:22
@blizzz
blizzz requested a review from marcelklehrJune 19, 2023 09:40
Comment threadlib/public/Files/IRootFolder.php
Comment threadlib/private/Files/FileInfo.php Outdated
blizzz added 5 commits June 21, 2023 16:53
- fixes a regression when deleting folders while music app was enabled,
for a LazyRoot was passed to this method.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
createNode() is protected and used by Folder, but being an internal-only
method it shall not be exposed in the Folder or IRootFolder interface.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz
blizzzforce-pushed the fix/noid/querysearchehelper-narrow-type branch from 0b32684 to 088a0eeCompareJune 21, 2023 14:53
@blizzz
blizzz requested a review from marcelklehrJune 21, 2023 14:53
@blizzz
blizzz merged commit 1751599 into masterJun 23, 2023
@blizzz
blizzz deleted the fix/noid/querysearchehelper-narrow-type branch June 23, 2023 22:13
@blizzz

Copy link
Copy Markdown
MemberAuthor

/backport to stable27

@blizzz

Copy link
Copy Markdown
MemberAuthor

/backport to stable26

@blizzz

Copy link
Copy Markdown
MemberAuthor

/backport to stable25

@backportbot-nextcloud

Copy link
Copy Markdown

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

# Switch to the target branch and update it
git checkout stable25
git pull origin stable25
# Create the new backport branch
git checkout -b fix/foo-stable25
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@szaimen

Copy link
Copy Markdown
Contributor

/backport to stable25

@backportbot-nextcloud

Copy link
Copy Markdown

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

# Switch to the target branch and update it
git checkout stable25
git pull origin stable25
# Create the new backport branch
git checkout -b fix/foo-stable25
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

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

Labels

3. to reviewWaiting for reviewsbugregression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't delete folders while the app is enabled

9 participants

@blizzz@JoshuaPettus@paulijar@szaimen@marcelklehr@icewind1991@github-advanced-security@come-nc@skjnldsv