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

fix(call): Fix incorrectly selected media when actually joining a call #9513

Merged
merged 3 commits into from May 12, 2023

Conversation

nickvergessen
Copy link
Member

☑️ Resolves

❓ Questions

  • We could also fix it the other way around and basically revert 27105c9 so it also writes without nextcloud_per_dGFsaw==_ again. The advantage would be that existing settings would be reused, which I would actually prefer.
  • Or in case the value is null, we check the old browser storage name to fallback. But that might be very cumbersome.

🏁 Checklist

@nickvergessen nickvergessen added 3. to review bug high regression feature: WebRTC 🚡 WebRTC connection between browsers and/or mobile clients feature: frontend 🖌️ "Web UI" client feature: call 📹 Voice and video calls labels May 10, 2023
@nickvergessen nickvergessen added this to the 💙 Next Beta (27) milestone May 10, 2023
@nickvergessen nickvergessen self-assigned this May 10, 2023
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

localStorage is still used for media state in App.vue (to restore the state when switching to another room while in a call).

It is also used in a store test, but I have not checked for what (nor why the test do not fail), and to save the nick of guests.

Regarding whether to fully embrace BrowserStorage or go back to localStorage so existing settings are reused I have no preference; I guess that the move to BrowserStorage was done for some reason, so fine to move it, but reuse the existing settings is good, so fine to go back as well :-P

@nickvergessen
Copy link
Member Author

and to save the nick of guests.

Yeah that has to stay, so text, collabora and talk use the same name.

Just trying to fix the regression between media settings and the actual call for now.

@nickvergessen
Copy link
Member Author

For the background i guess the idea was only consistency
#9347 (comment)
So might also be okay to revert for the time being and then fully migrate with a transition in the future?

Cc @ShGKme

@ShGKme
Copy link
Contributor

ShGKme commented May 10, 2023

For the background I guess the idea was only consistency

At least consistency, as we have an abstraction for Nextcloud apps. The same as with Axios where we always use @nextcloud/axios instead of any other HTTP client or custom axios extension.

In the general case, it also helps to keep values in a specific app scope, less global between apps.

So might also be okay to revert for the time being and then fully migrate with a transition in the future?

Is the only problem - to keep the current local (in browser) settings for local media settings?

@nickvergessen
Copy link
Member Author

nickvergessen commented May 10, 2023

Is the only problem - to keep the current local (in browser) settings for local media settings?

Well that would be why "reverting" would be better then "going forward with this PR".

At least consistency, as we have an abstraction for Nextcloud apps.

I get that, but it's also kind of annoying to break the setting.

But either thing needs to be done, so webrtc + media settings save/read from the same place. Currently whatever you do in the media settings is ignored in the call view and vice-versa

@nickvergessen
Copy link
Member Author

But okay, then let's go forward with this PR :)

@ShGKme
Copy link
Contributor

ShGKme commented May 10, 2023

So might also be okay to revert for the time being and then fully migrate with a transition in the future?

If we want to add migration in the next major (28), then, because of a long cycle, it will be migrated in almost a year in 29...

Maybe add it before the 27 rc.1, so it will have a migration during 27 and then remove plain LS in 28?

Aka

  1. Always use nextcloud's storage
  2. On loading check if migration was done
  3. If it wasn't - set nextcloud's storage to local storage, mark it as done

@nickvergessen
Copy link
Member Author

So might also be okay to revert for the time being and then fully migrate with a transition in the future?

If we want to add migration to the next major (28), then, because of a long cycle, it will be migrated in almost a year in 29...

Yeah well, we could immediately remove the migration logic again when stable28 is branched off (if it hurts, but i guess it does not)
Basically on App.vue load we would check if there is any audioDisabled_* or videoDisabled_* entry in localStorage, if yes loop over all of them and add them to BrowserStorage and remove them from localStorage

@nickvergessen
Copy link
Member Author

It is also used in a store test, but I have not checked for what (nor why the test do not fail),

@danxuliu So that works because BrowserStorage still uses localStorage and all the keys just have a prefix but the regex of the keys only checks for the end.

expect(localStorage.getItem.mock.calls[0][0]).toEqual(expect.stringMatching(/callprefs-XXTOKENXX-isgrid$/))

If that would be changed to /^callprefs-XXTOKENXX-isgrid$/ it would fail with:

    Expected: StringMatching /^callprefs-XXTOKENXX-isgrid$/
    Received: "nextcloud_per_dGFsaw==_callprefs-XXTOKENXX-isgrid"

But the missing leading ^ means it just checks for the end, so all good.

@nickvergessen nickvergessen force-pushed the bugfix/9501/fix-browser-storage-inconsistency branch from c1583c3 to 676d78f Compare May 10, 2023 20:32
@nickvergessen nickvergessen force-pushed the bugfix/9501/fix-browser-storage-inconsistency branch from 676d78f to 372719d Compare May 10, 2023 20:33
src/App.vue Outdated Show resolved Hide resolved
src/App.vue Outdated Show resolved Hide resolved
src/App.vue Outdated Show resolved Hide resolved
@nickvergessen nickvergessen requested a review from ShGKme May 11, 2023 11:28
src/init.js Outdated Show resolved Hide resolved
src/init.js Outdated Show resolved Hide resolved
@ShGKme
Copy link
Contributor

ShGKme commented May 11, 2023

Except for one issue, all works fine and looks good.

Also checked that no other storage item is missed.

@nickvergessen nickvergessen mentioned this pull request May 11, 2023
4 tasks
Signed-off-by: Joas Schilling <coding@schilljs.com>
Most values are copy-paste, but efore Talk 17 there was only a boolean
`virtualBackgroundEnabled_{token}` (stored as string) for the blur.
Now we also need to have a type and the default type is "none".
So when migrating the data for conversations the user had previously
enabled the background blur we also add the type with value blur.

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the bugfix/9501/fix-browser-storage-inconsistency branch from 60c4d85 to c1352e5 Compare May 11, 2023 12:53
@nickvergessen nickvergessen requested a review from ShGKme May 11, 2023 12:56
@nickvergessen nickvergessen merged commit 33b0041 into master May 12, 2023
19 checks passed
@nickvergessen nickvergessen deleted the bugfix/9501/fix-browser-storage-inconsistency branch May 12, 2023 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug feature: call 📹 Voice and video calls feature: frontend 🖌️ "Web UI" client feature: WebRTC 🚡 WebRTC connection between browsers and/or mobile clients high regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blur state is inverted in media settings on page load
4 participants