Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix hiding devices names over federation #10015

Merged
merged 7 commits into from
Oct 18, 2022

Conversation

aaronraimist
Copy link
Contributor

@aaronraimist aaronraimist commented May 19, 2021

Follow up to #9945. Turns out, while that PR appears to work most of the time there is one more spot where device names can be sent over federation.

I also noticed all these blank org.matrix.opentracing_context lines while I was debugging why my first PR wasn't working. I assume those don't need to be there unless opentracing is enabled so I also prevented those from being sent if they were blank.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
  • Pull request includes a sign off
  • Code style is correct (run the linters)

Signed-off-by: Aaron Raimist <aaron@raim.ist>
Signed-off-by: Aaron Raimist <aaron@raim.ist>
Signed-off-by: Aaron Raimist <aaron@raim.ist>
@aaronraimist aaronraimist marked this pull request as draft May 19, 2021 10:02
@erikjohnston
Copy link
Member

Did you want review of this, or is it still a WIP?

@aaronraimist
Copy link
Contributor Author

It is still WIP but I think I'm going to need some help to finish it.

I tested this patch locally using the demo federation script and it seemed to work. But then I installed it on my server and device names were still being shared so this PR must not have fixed it. I haven't been able to figure out how the device names are being shared. I asked in #synapse-dev:matrix.org a few days ago but it got lost.

@erikjohnston erikjohnston added the X-Awaiting-Changes A contributed PR which needs changes and re-review before it can be merged label Nov 1, 2021
@erikjohnston
Copy link
Member

Shout if/when this is ready for review 🙂

@aaronraimist aaronraimist marked this pull request as ready for review May 12, 2022 15:13
@aaronraimist aaronraimist requested a review from a team as a code owner May 12, 2022 15:13
@clokep clokep removed the X-Awaiting-Changes A contributed PR which needs changes and re-review before it can be merged label May 12, 2022
@squahtx
Copy link
Contributor

squahtx commented May 16, 2022

I tested this patch locally using the demo federation script and it seemed to work. But then I installed it on my server and device names were still being shared so this PR must not have fixed it. I haven't been able to figure out how the device names are being shared. I asked in #synapse-dev:matrix.org a few days ago but it got lost.

Does the PR work now? I'm missing some context here.

@aaronraimist
Copy link
Contributor Author

@squahtx context is that I still have not had time to take another look and this PR still probably does not fix 100% of the places where devices names can leak. However this PR is better than nothing since it definitely leaks without this PR and this feature is being turned on by default in 1.59.0rc1.

Unless someone else is able to put in some time to figure out all of the places where device names can leak then I would say just merge this and try to get it in to v1.59.0 so the feature at the top of the release notes is at least a bit more reliable.

Otherwise if this can't get in to v1.59.0, I would recommend postponing hiding device names over federation by default until someone has time to investigate it further.

Discussed at https://matrix.to/#/!XaqDhxuTIlvldquJaV:matrix.org/$A0Fo6Y5TQgS_mboU_QErLzehgW1xE9UE0hVcxQVeSUA?via=matrix.org&via=element.io&via=vector.modular.im

Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation! I agree that it makes sense to land this fix as-is. I've filed #12750 to track the leakiness.

As part of future work, we could look into automated testing for the option. I also wonder if it would be more appropriate for the logic to sit in a higher layer than the data store.

LGTM

@squahtx squahtx enabled auto-merge (squash) May 16, 2022 17:08
@squahtx
Copy link
Contributor

squahtx commented May 16, 2022

CI seems to be stuck from a year ago. Could you merge in the latest develop or a dummy commit to give it a kick?

@squahtx squahtx self-assigned this May 16, 2022
Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

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

Merging in the latest develop branch has revealed a handful of test failures unfortunately.
We'll want to investigate and fix them before merging.

@DMRobertson DMRobertson self-assigned this Oct 18, 2022
@DMRobertson
Copy link
Contributor

There is one failing sytest Can query remote device keys using POST after notification and one known flakey complement test. Otherwise no complaints.

DMRobertson pushed a commit to matrix-org/sytest that referenced this pull request Oct 18, 2022
@DMRobertson
Copy link
Contributor

I think this should pass (modulo complement flakes) with matrix-org/sytest#1307.

@anoadragon453
Copy link
Member

Note that this does not look to solve #13114 (tested manually).

DMRobertson pushed a commit to matrix-org/sytest that referenced this pull request Oct 18, 2022
* Allow HSes to omit device display names

Hopefully gets matrix-org/synapse#10015 over the line.

* Fix perl syntax?!?!
@squahtx squahtx merged commit 2a76a73 into matrix-org:develop Oct 18, 2022
@DMRobertson
Copy link
Contributor

Note that this does not look to solve #13114 (tested manually).

I'll update the changelog to reflect this.

DMRobertson pushed a commit that referenced this pull request Oct 20, 2022
@aaronraimist aaronraimist deleted the fix-hide-device-names branch October 21, 2022 05:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
X-Awaiting-Changes A contributed PR which needs changes and re-review before it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants