-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
prevent mixup of account timelines #4599
Conversation
@Provides | ||
@Named("defaultPort") | ||
fun providesDefaultPort(): Int { | ||
return 443 | ||
} | ||
|
||
@Provides | ||
@Named("defaultScheme") | ||
fun providesDefaultScheme(): String { | ||
return "https://" | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kinda weird, but the only way I found to have tests run on a random port without https.
Better ideas very welcome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we provide the whole URL depending on the current account?
Ok, I perf tested this and found no problems. There are a few KBs more memory used, activity start time is the same as before. I fixed a bug where sometimes the wrong api instance was used because the containing object was a Singleton and the api was not recreated after account switching. And I refactored a bit to have less code in the NetworkModule and make the testing simpler. Please have another look. |
regression from #4599 https://pug.ninja/@motoridersd/113102603349423738 The problem is, `MediaUploader` is no longer a singleton, so the state is not correctly shared between `ComposeActivity` and `SendStatusService.` But it can't be a singleton, since `MediaUploadApi` (injected into `MediaUploader`) needs to be recreated on account change. Let's share the state in the companion object instead.
This does 2 things:
AccountSwitchInterceptor
, the main culprit for the bug. APIs can no longer change their base url after they have been created. As a result they are not Singletons anymore.Here is how I could reliably reproduce the bug:
closes #4567
closes #4554
closes #4402
closes #4148
closes #2663
and possibly #4588