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(client/android): fix android network receiver while still supporting android 10 #2217

Merged
merged 14 commits into from
Oct 16, 2024

Conversation

daniellacosse
Copy link
Contributor

@daniellacosse daniellacosse commented Sep 24, 2024

IMG_2398.MOV

@daniellacosse daniellacosse changed the title fix(cordova/android): fix android receiver fix(client/android): fix android receiver Sep 24, 2024
Copy link
Collaborator

@fortuna fortuna left a comment

Choose a reason for hiding this comment

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

Please make sure the client is working after the changes

client/src/cordova/plugin/plugin.xml Outdated Show resolved Hide resolved
Copy link
Collaborator

@fortuna fortuna left a comment

Choose a reason for hiding this comment

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

Please add comments to the code explaining why we need them

@daniellacosse daniellacosse marked this pull request as draft September 24, 2024 19:03
@daniellacosse
Copy link
Contributor Author

Please make sure the client is working after the changes

Yeah, sorry, I should have made this a draft

@daniellacosse daniellacosse added the needs test Pull requests that require tests label Oct 3, 2024
@daniellacosse daniellacosse changed the title fix(client/android): fix android receiver fix(client/android): fix android network receiver while still supporting android 10 Oct 15, 2024
@daniellacosse daniellacosse marked this pull request as ready for review October 15, 2024 14:18
@daniellacosse daniellacosse requested a review from a team as a code owner October 15, 2024 14:18
@sbruens
Copy link
Contributor

sbruens commented Oct 15, 2024

Please add comments to the code explaining why we need them

Could you still do this? It will be helpful for future readers to know what settings are important and why, so they don't change them.

Copy link
Contributor

@sbruens sbruens left a comment

Choose a reason for hiding this comment

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

See my comment on adding some code comments where appropriate. Otherwise this LGTM, assuming it works on the various Android versions.

@daniellacosse
Copy link
Contributor Author

daniellacosse commented Oct 15, 2024

Please add comments to the code explaining why we need them

Could you still do this? It will be helpful for future readers to know what settings are important and why, so they don't change them.

Generally my principle with inline code comments is to annotate things that aren't really behaving as intended (hacks and things like that). Comments get old and often lie, so there's an inherent risk in using them. If we comment this, the threshold for adding comments now becomes "anything that someone is likely not skilled enough in" which in my experience is fairly annoying to those who are literate in the space. Imagine for example commenting "sets the width to 100%" on the css property width: 100% every time (which may actually not always be the case if the element's display property is set to inline for instance). Comments like that on every other line ultimately pollute the source with "eventually false" information, imo.

I think as a compromise I can simply link to the relevant documentation in the comment, rather than write a paragraph attempting to explain how android works to the reader. The hope there is the documentation stays up to date. Is that fair?

@sbruens
Copy link
Contributor

sbruens commented Oct 15, 2024

Imagine for example commenting "sets the width to 100%" on the css property width: 100% every time (which may actually not always be the case if the element's display property is set to inline for instance). Comments like that on every other line ultimately pollute the source with "eventually false" information, imo.

To be fair, that example is not quite the same. I'm not suggesting you comment what the code is doing, but why it's needed (see http://go/comments#reasons).

I think as a compromise I can simply link to the relevant documentation in the comment, rather than write a paragraph attempting to explain how android works to the reader. The hope there is the documentation stays up to date. Is that fair?

Thanks, yeah that's totally fine. I'm not expecting a liberally commented PR. You're just making very specific changes that are clearly non-trivial, but they are not self-describing. So to avoid future readers needing to dig it will be helpful context on why these specific settings are needed, or what the magic number means, so that someone doesn't inevitable try to remove it, especially because we don't have a regression tests for this.

@daniellacosse
Copy link
Contributor Author

Imagine for example commenting "sets the width to 100%" on the css property width: 100% every time (which may actually not always be the case if the element's display property is set to inline for instance). Comments like that on every other line ultimately pollute the source with "eventually false" information, imo.

To be fair, that example is not quite the same. I'm not suggesting you comment what the code is doing, but why it's needed (see http://go/comments#reasons).

I think as a compromise I can simply link to the relevant documentation in the comment, rather than write a paragraph attempting to explain how android works to the reader. The hope there is the documentation stays up to date. Is that fair?

Thanks, yeah that's totally fine. I'm not expecting a liberally commented PR. You're just making very specific changes that are clearly non-trivial, but they are not self-describing. So to avoid future readers needing to dig it will be helpful context on why these specific settings are needed, or what the magic number means, so that someone doesn't inevitable try to remove it, especially because we don't have a regression tests for this.

Done!

@daniellacosse daniellacosse enabled auto-merge (squash) October 16, 2024 14:55
@daniellacosse daniellacosse merged commit 14dc63d into master Oct 16, 2024
23 checks passed
@daniellacosse daniellacosse deleted the daniellacosse/fix-android-receiver branch October 16, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs test Pull requests that require tests size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants