Skip to content

Modified RobustNetworkOperation to send a UserAgent string#1492

Merged
tombogle merged 3 commits intomasterfrom
set-http-request-header-user-agent
Feb 26, 2026
Merged

Modified RobustNetworkOperation to send a UserAgent string#1492
tombogle merged 3 commits intomasterfrom
set-http-request-header-user-agent

Conversation

@tombogle
Copy link
Contributor

@tombogle tombogle commented Feb 26, 2026

Trying to see if this might prevent CI test failure.


Open with Devin

This change is Reviewable

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

Palaso Tests

     4 files  ±0       4 suites  ±0   10m 21s ⏱️ - 1m 10s
 5 092 tests ±0   4 859 ✅ +1  233 💤 ±0  0 ❌  - 1 
16 591 runs  ±0  15 871 ✅ +2  720 💤  - 1  0 ❌  - 1 

Results for commit fe2a8e8. ± Comparison against base commit 34a3d78.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

@andrew-polk reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ddaspit and tombogle).


SIL.Core.Desktop/Network/RobustNetworkOperation.cs line 131 at r1 (raw file):

				{
					client.Proxy = proxy;
					client.Headers[HttpRequestHeader.UserAgent] = DefaultUserAgent;

Probably wants some comments.
Why do we need this?
Why do we only add it on this request?
Why do we want this particular useragent string as the default?

Copy link
Contributor Author

@tombogle tombogle left a comment

Choose a reason for hiding this comment

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

@tombogle made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on andrew-polk and ddaspit).


SIL.Core.Desktop/Network/RobustNetworkOperation.cs line 131 at r1 (raw file):

Previously, andrew-polk wrote…

Probably wants some comments.
Why do we need this?
Why do we only add it on this request?
Why do we want this particular useragent string as the default?

Made the CI test pass. I didn't look at anything else. This was the one that was needed to fix the breaking test. ChatGPT said that was a good useragent string, and it worked. I just barely tried to digest its meaning.

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

@andrew-polk made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ddaspit and tombogle).


SIL.Core.Desktop/Network/RobustNetworkOperation.cs line 131 at r1 (raw file):

Previously, tombogle (Tom Bogle) wrote…

Made the CI test pass. I didn't look at anything else. This was the one that was needed to fix the breaking test. ChatGPT said that was a good useragent string, and it worked. I just barely tried to digest its meaning.

Does it make sense to have a way for the tests to pass in a useragent string?
Maybe I'm just being dense, but I don't understand why it is ok to have production code suddenly sending a default useragent string which might not be correct.

@tombogle
Copy link
Contributor Author

SIL.Core.Desktop/Network/RobustNetworkOperation.cs line 131 at r1 (raw file):

Previously, andrew-polk wrote…

Does it make sense to have a way for the tests to pass in a useragent string?
Maybe I'm just being dense, but I don't understand why it is ok to have production code suddenly sending a default useragent string which might not be correct.

If the tests need it, it might also be the case that there could be situations where it is also required in production. It does feel like a bit of a hack (now that I'm taking a little time to almost understand it). We could make it an optional parameter to the method and make the constant public in case a real client needed to make it work and just wanted an easy way to spoof it.

@tombogle
Copy link
Contributor Author

SIL.Core.Desktop/Network/RobustNetworkOperation.cs line 131 at r1 (raw file):

Previously, tombogle (Tom Bogle) wrote…

If the tests need it, it might also be the case that there could be situations where it is also required in production. It does feel like a bit of a hack (now that I'm taking a little time to almost understand it). We could make it an optional parameter to the method and make the constant public in case a real client needed to make it work and just wanted an easy way to spoof it.

I think maybe I've come up with a satisfactory approach and really great comments.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

@andrew-polk reviewed 3 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ddaspit and tombogle).


SIL.Core.Desktop/Network/RobustNetworkOperation.cs line 131 at r1 (raw file):

and really great comments

exceptionally great

…fo to allow a client to mimic a real browser if necessary.

Also improved the comments
@tombogle tombogle force-pushed the set-http-request-header-user-agent branch from 771faee to fe2a8e8 Compare February 26, 2026 22:46
Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

@andrew-polk reviewed 2 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ddaspit).

@tombogle tombogle merged commit 0b3665c into master Feb 26, 2026
11 checks passed
@tombogle tombogle deleted the set-http-request-header-user-agent branch February 26, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants