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

Element call url param #1477

Merged
merged 3 commits into from
Oct 2, 2023
Merged

Element call url param #1477

merged 3 commits into from
Oct 2, 2023

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Oct 2, 2023

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Pass parameter appPrompt and confineToRoom in the fragment part of the URL

FTR: iOS PR: element-hq/element-x-ios#1833

Motivation and context

Better Element Call URL. Those parameters does not need to reach the server.

Screenshots / GIFs

Tests

  • Just updated the unit test.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@bmarty bmarty requested a review from a team as a code owner October 2, 2023 11:56
@bmarty bmarty requested review from julioromano and removed request for a team October 2, 2023 11:56
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2023

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/xWYwPx

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (5b3d340) 58.38% compared to head (566f096) 58.40%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1477      +/-   ##
===========================================
+ Coverage    58.38%   58.40%   +0.02%     
===========================================
  Files         1133     1133              
  Lines        30264    30281      +17     
  Branches      6196     6201       +5     
===========================================
+ Hits         17669    17686      +17     
  Misses        9943     9943              
  Partials      2652     2652              
Files Coverage Δ
...ment/android/features/call/CallIntentDataParser.kt 95.23% <100.00%> (+3.23%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmarty bmarty requested a review from dbkr October 2, 2023 14:48
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

Looks okay I think, although if it were me I would probably try to use Android's query string parsing/building to do the work, even though this is really awkward because 1. they only work on whole URLs for some reason, so you'd have to construct an intermediate fake URL builder with the fragment query as the real query string, using that to build a query string and 2. the classes to read and build URLs are separate so you'd need one of each to examine the old fragment query string and one to create the edited one.

I think this is okay though, might just behave oddly if it were given params with no values or something.

@bmarty
Copy link
Member Author

bmarty commented Oct 2, 2023

Looks okay I think, although if it were me I would probably try to use Android's query string parsing/building to do the work, even though this is really awkward because 1. they only work on whole URLs for some reason, so you'd have to construct an intermediate fake URL builder with the fragment query as the real query string, using that to build a query string and 2. the classes to read and build URLs are separate so you'd need one of each to examine the old fragment query string and one to create the edited one.

I think this is okay though, might just behave oddly if it were given params with no values or something.

I agree, there is lots of manual stuff, this is not ideal. Unit tests are helping to reassures us. One other thing, the Uri builder will URL-encode the fragment, and I do not think we want this...

@bmarty bmarty merged commit 181a7b7 into develop Oct 2, 2023
@bmarty bmarty deleted the feature/bma/elementCallUrlParam branch October 2, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants