Skip to content

set the display name of federated sharees from addressbook - #24162

Merged
blizzz merged 1 commit into
masterfrom
fix/noid/fedshares-displaynamez
Nov 24, 2020
Merged

set the display name of federated sharees from addressbook#24162
blizzz merged 1 commit into
masterfrom
fix/noid/fedshares-displaynamez

Conversation

@blizzz

@blizzzblizzz commented Nov 16, 2020

Copy link
Copy Markdown
Member

To reproduce:

  1. Have two instances
  2. Make them trust each other
  3. Share one file from instance A to instance B
  4. As target user on instance B accept
  5. Go to files

Expect to see the display name of the user who initiated the share.

Acutal: you see the user's internal(!) id.

Before the fix:

Screenshot_20201116_180259

After:

Screenshot_20201116_180414

@skjnldsv in the UI only the host is show. But my instances are running within subfolders, e.g. /stable20 was cut off. Intentionally or a bug?

What I am not so happy about is that it adds another SQL query per incoming federated share to figure out the displayname. I don't have a much better ideas though, I hope it is acceptable.

It "boroughs" some code from https://github.com/nextcloud/server/blob/master/apps/federatedfilesharing/lib/Notifier.php#L249 but to clean it up properly will take more changes, but I want to keep it backportable.

It also takes hold of getDisplayId which is to some degree paradox.

Thus, having a bit of mixed feelings at the moment.

Todo

  • adjust tests

Comment threadlib/private/Federation/CloudIdManager.php
@blizzz
blizzzforce-pushed the fix/noid/fedshares-displaynamez branch from 70690e5 to 8e63cd8CompareNovember 20, 2020 13:16

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code makes sense and has tests 🕺

@blizzz

Copy link
Copy Markdown
MemberAuthor

ah, some more tests to patch

@blizzz
blizzzforce-pushed the fix/noid/fedshares-displaynamez branch 2 times, most recently from b8e969e to 9da6061CompareNovember 23, 2020 22:54
@blizzz

Copy link
Copy Markdown
MemberAuthor

ah, some more tests to patch

and even more of those 🎊

@faily-bot

This comment has been minimized.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz
blizzzforce-pushed the fix/noid/fedshares-displaynamez branch from 7264f97 to 16a78f5CompareNovember 24, 2020 10:30
@blizzzblizzz added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels Nov 24, 2020
@blizzz
blizzz merged commit 5d03b5c into masterNov 24, 2020
@blizzz
blizzz deleted the fix/noid/fedshares-displaynamez branch November 24, 2020 16:23
@blizzz

Copy link
Copy Markdown
MemberAuthor

/backport to stable20

@blizzz

Copy link
Copy Markdown
MemberAuthor

/backport to stable19

@blizzz

Copy link
Copy Markdown
MemberAuthor

oh f*ck me. While making the tests pass i had a slight adjustment necessary in the logic. Backfired of course. Follow up coming.

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

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugfeature: federationfeature: sharing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@blizzz@ChristophWurst@skjnldsv