Skip to content

feat(neon_framework): queue for request manager to limit parallel req… - #3184

Open
vauvenal5 wants to merge 2 commits into
nextcloud:mainfrom
vauvenal5:upstream/request-manager-queue
Open

feat(neon_framework): queue for request manager to limit parallel req…#3184
vauvenal5 wants to merge 2 commits into
nextcloud:mainfrom
vauvenal5:upstream/request-manager-queue

Conversation

@vauvenal5

@vauvenal5 vauvenal5 commented Mar 14, 2026

Copy link
Copy Markdown
Collaborator

Limits the amount of parallel requests to the server to not overload it with preview requests when opening a big gallery and scrolling through it.

As agreed in #1124 this is a first step.

Comment thread packages/neon_framework/lib/src/utils/request_manager.dart Outdated
@vauvenal5
vauvenal5 force-pushed the upstream/request-manager-queue branch from 1b86360 to 19674e5 Compare June 8, 2026 06:33
Comment thread packages/neon_framework/lib/src/utils/request_manager.dart Outdated
@vauvenal5
vauvenal5 force-pushed the upstream/request-manager-queue branch from 19674e5 to 53e104e Compare June 8, 2026 11:40

@provokateurin provokateurin 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.

Cool, thanks!

@provokateurin

Copy link
Copy Markdown
Member

Can you check the test results and try to reproduce locally? I think they could be related.

@vauvenal5
vauvenal5 force-pushed the upstream/request-manager-queue branch from 53e104e to 18f9b60 Compare August 15, 2026 15:29
@vauvenal5

Copy link
Copy Markdown
Collaborator Author

I have to look deeper into this but I believe it is a timing issue. The bigger the delay in the test the more refresh calls pass and the expected amount does not match anymore. I guess my changes lead the more calls passing but not sure yet of the details.

@vauvenal5
vauvenal5 force-pushed the upstream/request-manager-queue branch from 18f9b60 to 2d17495 Compare August 16, 2026 10:43
@vauvenal5

Copy link
Copy Markdown
Collaborator Author

Okay I believe I have narrowed it down. There are actually 5 events which call talkBloc.updateRoom not 4.

  1. BehaviorSubject.seeded(Result.success(room))
    2+3) From the refresh in the constructor
    4+5) From the refresh in the test

Due to the timing it does not show up in the test until you set a sleep also after the the refresh call in the test:

// The delay is necessary to avoid a race condition with loading twice at the same time
await Future<void>.delayed(const Duration(milliseconds: 1));
await roomBloc.refresh();
await Future<void>.delayed(const Duration(milliseconds: 1));

verify(() => talkBloc.updateRoom(any())).called(4);

My change seems to every slightly switch timing making all calls finish before the verify gets triggered in the test.

I refactored the test a bit making the behavior more deterministic.

…uests to server

Signed-off-by: vauvenal5 <vauvenal5.ndgme@slmails.com>
@vauvenal5
vauvenal5 force-pushed the upstream/request-manager-queue branch from 2d17495 to 9a60b0b Compare August 16, 2026 10:58
Signed-off-by: vauvenal5 <vauvenal5.ndgme@slmails.com>
@vauvenal5
vauvenal5 force-pushed the upstream/request-manager-queue branch from c1ad79f to 5aa811f Compare August 16, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants