Skip to content

document-export: Parse the AddNamed reply for --noexist - #6847

Merged
swick merged 2 commits into
flatpak:mainfrom
razzeee:fix/blackbox-document-noexist
Sep 25, 2026
Merged

swick merged 2 commits into
flatpak:mainfrom
razzeee:fix/blackbox-document-noexist

Conversation

@razzeee

@razzeee razzeee commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

With --noexist, the opened file descriptor refers to the parent directory.
The request correctly uses AddNamed, but is_directory makes the reply
parser expect AddFull's array reply instead of AddNamed's single string.
This produces a GVariant type mismatch and crashes the command.

Only select the AddFull reply parser for directory exports without
--noexist, matching the method used for the request.

Comment thread tests/libtest.sh Fixed
Comment thread tests/libtest.sh Fixed
Comment thread tests/libtest.sh Fixed
@swick

swick commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Looks fine, but would be nice to fix the shell check issues

@razzeee
razzeee force-pushed the fix/blackbox-document-noexist branch from 9ddb76e to be1d715 Compare September 22, 2026 20:13
@razzeee

razzeee commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

@swick should be fixed, sorry, forgot about these, cause of another branch also throwing shell check :)

@swick

swick commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Let's get #6848 merged first so you can rebase on top of that for the test setup.

With --noexist, the opened file descriptor refers to the parent directory.
The request correctly uses AddNamed, but is_directory makes the reply
parser expect AddFull's array reply instead of AddNamed's single string.
This produces a GVariant type mismatch and crashes the command.

Only select the AddFull reply parser for directory exports without
--noexist, matching the method used for the request.
Exercise existing files, directories and nonexistent files against a real
document portal on the private test bus. Verify that --noexist returns a
usable export after the origin is created and preserves its read grant.

The regression fails on the AddNamed reply type mismatch without the fix.
All four checks pass with it.
@razzeee
razzeee force-pushed the fix/blackbox-document-noexist branch from be1d715 to e17ac7d Compare September 24, 2026 16:16
@swick
swick added this pull request to the merge queue Sep 25, 2026
Merged via the queue into flatpak:main with commit dcfc136 Sep 25, 2026
11 checks passed
@smcv

smcv commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

With --noexist, the opened file descriptor refers to the parent directory. The request correctly uses AddNamed, but is_directory makes the reply parser expect AddFull's array reply instead of AddNamed's single string. This produces a GVariant type mismatch and crashes the command.

This doesn't really make it obvious what user-facing bug you were fixing with this change, and I had to reverse-engineer it while updating the release notes. In future it would be helpful for MRs that fix a bug to contain a solution-neutral problem statement for what bug is being fixed, or a link to an issue report with a solution-neutral problem statement.

@razzeee
razzeee deleted the fix/blackbox-document-noexist branch September 28, 2026 10:20
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.

4 participants