Skip to content

table-printer: Fix left boundary check in comma-unique cell dedup - #6825

Merged
swick merged 1 commit into
flatpak:mainfrom
kylin-liwn:fix/table-printer-comma-unique-left-boundary
Sep 22, 2026
Merged

swick merged 1 commit into
flatpak:mainfrom
kylin-liwn:fix/table-printer-comma-unique-left-boundary

Conversation

@kylin-liwn

@kylin-liwn kylin-liwn commented Sep 9, 2026 •

Copy link
Copy Markdown

In flatpak_table_printer_append_cell_with_comma_unique, the duplicate
check only verified the right boundary (match[len] == 0 or comma).
This caused false positives: searching for "all" in "superall" matched
because the character after "all" happened to be a comma, even though
"all" was a substring of "superall", not a separate comma-delimited
entry.

Calculate the position of each match via pointer arithmetic
(match - cell->text) and use cell->text[pos - 1] to check the left
boundary, so that a match is only treated as duplicate when it is at
the start of the cell or preceded by a comma.

Comment thread app/flatpak-table-printer.c Outdated
@kylin-liwn
kylin-liwn requested a review from swick September 20, 2026 05:35
@swick

swick commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Please squash the changes. We use clean commit histories here.

@kylin-liwn
kylin-liwn force-pushed the fix/table-printer-comma-unique-left-boundary branch 6 times, most recently from fa7a945 to 229a23e Compare September 22, 2026 01:26
In flatpak_table_printer_append_cell_with_comma_unique, the duplicate
check only verified the right boundary (match[len] == 0 or comma).
This caused false positives: searching for "all" in "superall" matched
because the character after "all" happened to be a comma, even though
"all" was a substring of "superall", not a separate comma-delimited
entry.

Calculate the position of each match via pointer arithmetic
(match - cell->text) and use cell->text[pos - 1] to check the left
boundary, so that a match is only treated as duplicate when it is at
the start of the cell or preceded by a comma.
@kylin-liwn
kylin-liwn force-pushed the fix/table-printer-comma-unique-left-boundary branch from 229a23e to 550a8b1 Compare September 22, 2026 01:28
@kylin-liwn kylin-liwn changed the title fix: check left boundary in comma-unique cell dedup table-printer: Fix left boundary check in comma-unique cell dedup Sep 22, 2026
@kylin-liwn

Copy link
Copy Markdown
Author

Done! I've squashed the commits and updated the message. Please take another look.

@swick
swick added this pull request to the merge queue Sep 22, 2026
Merged via the queue into flatpak:main with commit 9c9c9d3 Sep 22, 2026
11 checks passed
@smcv

smcv commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

In flatpak_table_printer_append_cell_with_comma_unique, the duplicate check only verified the right boundary (match[len] == 0 or comma).

This doesn't really say 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.

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.

3 participants