Skip to content

fix(linux/xdgportal): Additional error handling and minor code improvements#4979

Merged
ReenigneArcher merged 3 commits intoLizardByte:masterfrom
Kishi85:xdgportal-additional-errorhandling
Apr 13, 2026
Merged

fix(linux/xdgportal): Additional error handling and minor code improvements#4979
ReenigneArcher merged 3 commits intoLizardByte:masterfrom
Kishi85:xdgportal-additional-errorhandling

Conversation

@Kishi85
Copy link
Copy Markdown
Contributor

@Kishi85 Kishi85 commented Apr 12, 2026

Description

  • Adds error handling in case the portal does not return a stream that can be used (potential for out-of-bounds read on the vector for the fallback stream)
  • Ensure pipewire modules are loaded only when needed during portal_display() and not early during portal_display_names() enumeration. Otherwise Pipewire might be initialized even when never used.
  • Fix some code issues (as reported by SonarQube for IDE)

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@Kishi85 Kishi85 force-pushed the xdgportal-additional-errorhandling branch 5 times, most recently from 1a089f7 to 310e2b4 Compare April 12, 2026 08:56
@ReenigneArcher ReenigneArcher added this to the xdg portal grab milestone Apr 12, 2026
@Kishi85 Kishi85 changed the title fix(linux/xdgportal): Additional error handling and code quality improvements fix(linux/xdgportal): Additional error handling and minor code quality improvements Apr 12, 2026
@Kishi85 Kishi85 changed the title fix(linux/xdgportal): Additional error handling and minor code quality improvements fix(linux/xdgportal): Additional error handling and minor code improvements Apr 12, 2026
@ReenigneArcher ReenigneArcher force-pushed the xdgportal-additional-errorhandling branch from 310e2b4 to c360296 Compare April 13, 2026 12:46
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Bundle Report

Bundle size has no change ✅

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@94137da). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/linux/portalgrab.cpp 12.50% 7 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #4979   +/-   ##
=========================================
  Coverage          ?   17.96%           
=========================================
  Files             ?      108           
  Lines             ?    23424           
  Branches          ?    10340           
=========================================
  Hits              ?     4209           
  Misses            ?    15813           
  Partials          ?     3402           
Flag Coverage Δ
Archlinux 11.60% <0.00%> (?)
FreeBSD-14.3-amd64 13.59% <12.50%> (?)
Homebrew-ubuntu-22.04 13.92% <0.00%> (?)
Linux-AppImage 12.21% <12.50%> (?)
Windows-AMD64 14.90% <ø> (?)
Windows-ARM64 13.22% <ø> (?)
macOS-arm64 19.02% <ø> (?)
macOS-x86_64 18.37% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/linux/portalgrab.cpp 4.54% <12.50%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94137da...c360296. Read the comment docs.

@ReenigneArcher ReenigneArcher merged commit 5a41707 into LizardByte:master Apr 13, 2026
73 checks passed
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