Skip to content

fix: pass boardId to attachmentController - #7708

Merged
grnd-alt merged 1 commit into
mainfrom
fix/federation-wrong-references
Mar 17, 2026
Merged

grnd-alt merged 1 commit into
mainfrom
fix/federation-wrong-references

Conversation

@grnd-alt

@grnd-alt grnd-alt commented Mar 4, 2026

Copy link
Copy Markdown
Member

this PR prevents requests on federated boards from being wrongly associated.
By passing the current boardId to the controller we can check if the board is a federated board and then block the request.

If the boardId is not passed we assume the board is local, as the client knows what it received from the BE before, and can that way spare the query to get the localBoard (in a future pr).

An attempt to show the error that currently happens and requires the change:
image

@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

馃悽 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 84627 was 84323 (+0.36%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

@grnd-alt
grnd-alt force-pushed the fix/federation-wrong-references branch from 209592f to 83478a3 Compare March 4, 2026 13:55
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

馃悽 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 84624 was 84323 (+0.35%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

@grnd-alt
grnd-alt marked this pull request as ready for review March 4, 2026 14:02
@grnd-alt
grnd-alt requested review from blizzz and juliusknorr March 4, 2026 14:03
Comment thread lib/Service/AttachmentService.php Outdated
@grnd-alt
grnd-alt force-pushed the fix/federation-wrong-references branch from 83478a3 to 5f23187 Compare March 5, 2026 11:22
@grnd-alt
grnd-alt requested a review from blizzz March 5, 2026 11:22
@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

馃悽 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 84618 was 84323 (+0.34%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

@github-project-automation github-project-automation Bot moved this to 馃Л Planning evaluation (don't pick) in 馃摑 Productivity team Mar 5, 2026
@grnd-alt grnd-alt moved this from 馃Л Planning evaluation (don't pick) to 馃憖 In review in 馃摑 Productivity team Mar 5, 2026
@grnd-alt grnd-alt self-assigned this Mar 5, 2026
@grnd-alt
grnd-alt force-pushed the fix/federation-wrong-references branch from 5f23187 to d14b202 Compare March 5, 2026 13:32
@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

馃悽 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 84623 was 84323 (+0.35%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

Comment thread lib/Controller/AttachmentOcsController.php
private function ensureLocalBoard(?int $boardId): void {
if ($boardId) {
$board = $this->boardService->find($boardId);
if ($board->getExternalId()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe add a check to ensure that the board exists before accessing it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's already integrated in the boardservice/permissionservice to throw NoPermission when the board does not exist

Signed-off-by: grnd-alt <git@belakkaf.net>
@grnd-alt
grnd-alt force-pushed the fix/federation-wrong-references branch from d14b202 to 696ca2f Compare March 17, 2026 08:55
@grnd-alt
grnd-alt merged commit 446b3de into main Mar 17, 2026
43 checks passed
@grnd-alt
grnd-alt deleted the fix/federation-wrong-references branch March 17, 2026 14:38
@github-project-automation github-project-automation Bot moved this from 馃憖 In review to 鈽戯笍 Done in 馃摑 Productivity team Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants