Skip to content

make request/response builders actually build#4366

Open
gudvinr wants to merge 3 commits into
miniflux:mainfrom
gudvinr:feature/request_builder_build
Open

make request/response builders actually build#4366
gudvinr wants to merge 3 commits into
miniflux:mainfrom
gudvinr:feature/request_builder_build

Conversation

@gudvinr

@gudvinr gudvinr commented May 27, 2026

Copy link
Copy Markdown
Contributor

It's a follow-up for #4353. Sorry for the noise.

Didn't occur to me that request/response builders are actually not being used as builders.

Couple notes here:

  1. CreateFeedFromSubscriptionDiscovery made useless builder. It is supposedly intended to be used with NewIconChecker but NewIconChecker makes its own builder.
    I removed builder in CreateFeedFromSubscriptionDiscovery because it wasn't used. If that's the one actually should've been used in first place, please let me know.

  2. In theory builders should be immutable. I.e. if you do newBuilder := oldBuilder.Sumsin(...), state of oldBuilder is unchanged.

With that assumption in mind (this is just my guess) subscriptionFinder.findSubscriptionsFromWellKnownURLs called WithoutRedirects in a loop for each URL. That in theory should create ephemeral builder with redirects disabled but in fact it just disables redirects over and over for no reason.

To be able to use that technique one probably should actually make real builder that doesn't change global builder state. However, currently no builder in miniflux does that and it'd be quite tedious task for basically no gain.

I've decided to just move WithoutRedirects up so it's just explicitly does what it's already doing. If something else should be done insted, I'm all ears.


Have you followed these guidelines?

@gudvinr gudvinr force-pushed the feature/request_builder_build branch from 5048042 to 901afaa Compare May 29, 2026 17:45

@fguillot fguillot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is a regression in FindSubscriptions. Previously redirects were only disabled for well-known feed probes in findSubscriptionsFromWellKnownURLs. Now the WithoutRedirects() is applied to the shared RequestBuilder before FindSubscriptions(). This breaks common subscription flows with expected redirects.

@gudvinr

gudvinr commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Previously redirects were only disabled for well-known feed probes in findSubscriptionsFromWellKnownURLs.

As WithRedirects changes struct field by pointer, redirects were disabled for well-known probes and all probes after first WithRedirects. If I understand this code correctly.


Went back to previous behaviour anyway. This indeed doesn't look like a good solution.

gudvinr added 3 commits June 6, 2026 19:29
Correct use of builder assumes that each step makes isolated instance. Thus, not using result of build step makes builder just ignore that action.
@gudvinr gudvinr force-pushed the feature/request_builder_build branch from 901afaa to 78be371 Compare June 6, 2026 16:36
@gudvinr gudvinr requested a review from fguillot June 6, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants