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

Fixed deprecation warning Node.attributes.displayname should be accessed directly on the Node #1074

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

dvaerum
Copy link
Contributor

@dvaerum dvaerum commented Sep 10, 2024

Hey Nextcloud people.

I can see that I get a lot of these warning in the console of my browser (Firefox). They are floating my console so much that it prevents me from using it to find another bug/issue/problem on Nextcloud 😓

[WARN] @nextcloud/files: Accessing "Node.attributes.displayname" is deprecated, access it directly on the Node instance. 
Object { app: "@nextcloud/files", uid: "dvaerum", level: 2 }
[index.mjs:51:16](webpack:///nextcloud/node_modules/@nextcloud/logger/dist/index.mjs)

and I believe that I have traced it down to this line

(v: INode) => basename(v.attributes?.displayname || v.basename),

Which uses v.attributes?.displayname instead of v.displayname.

Sorry, I don't follow the contributor guidelines, but I did not see any.

@skjnldsv
Copy link
Contributor

Thanks Denis! We'll investigate :)

susnux
susnux previously approved these changes Sep 11, 2024
Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

makes sense

@susnux susnux dismissed their stale review September 11, 2024 12:00

There is a problem if there is an outdated app that uses a library version that does not provide displayname

lib/utils/fileSorting.ts Outdated Show resolved Hide resolved
@dvaerum dvaerum requested a review from susnux September 13, 2024 21:14
@susnux susnux requested a review from skjnldsv September 13, 2024 21:33
@dvaerum
Copy link
Contributor Author

dvaerum commented Sep 13, 2024

Hey @susnux

Do you know there I find the rules for commit messages because it looks like I need to update one of them

Block unconventional commits / Block unconventional commits (pull_request) 

It is obvious what I need to correct 😕

@susnux
Copy link
Contributor

susnux commented Sep 13, 2024

Yes please squash you commits and use conventional commits like:
fix(sorting): access displayname directly on Node

See https://www.conventionalcommits.org/en/v1.0.0/

…f `Node.displayname` is not available

Co-authored-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Dennis Vestergaard Værum <[email protected]>
@dvaerum
Copy link
Contributor Author

dvaerum commented Sep 13, 2024

Hey @susnux

I believe that I have fixed the commit names. I didn't find your YAML config for configuring git-conventional-commits, so I just went with the one used in the example here:
https://github.com/qoomon/git-conventional-commits?tab=readme-ov-file#config-file

@dvaerum dvaerum requested a review from susnux September 13, 2024 22:23
@skjnldsv skjnldsv enabled auto-merge September 14, 2024 07:44
@skjnldsv skjnldsv merged commit 5562732 into nextcloud-libraries:main Sep 14, 2024
15 checks passed
@skjnldsv skjnldsv mentioned this pull request Oct 23, 2024
@susnux susnux mentioned this pull request Nov 13, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants