Skip to content

🐛 Improve launcher error handling across dialog platforms - #633

Merged
vinceglb merged 41 commits into
mainfrom
improve-launcher-error
Aug 8, 2026
Merged

🐛 Improve launcher error handling across dialog platforms#633
vinceglb merged 41 commits into
mainfrom
improve-launcher-error

Conversation

@vinceglb

@vinceglb vinceglb commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add consistent launcher failure handling and public dialog/picker exceptions.
  • Preserve JVM and Android binary compatibility for existing launcher APIs.
  • Improve platform-specific dialog parent, fallback, sharing, camera, picker, and saver behavior.
  • Update samples and documentation with the new error-handling guidance.

Testing

  • Added common, JVM, Android, iOS, and multiplatform regression tests for failure paths and call shapes.
  • Added JVM and Android binary compatibility tests using legacy consumers.
  • Validation commands were not provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4de163789d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Native picker calls inherited the legacy Windows dialog failure policy, so expected HRESULT failures leaked as IllegalStateException. Select the picker operational policy and wrap only its internal failure as FileKitPickerException, with retained native coverage for cancellation and exclusions.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e956f16cf1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 099c7d8293

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d32980e4e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread specs/adr/0001-own-dialog-operational-failures.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 398ee62430

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread specs/adr/0001-own-dialog-operational-failures.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b198eb65f1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread specs/adr/0001-own-dialog-operational-failures.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7367b44c5f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f0b3aa448

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

): PickerLaunchResult = try {
launch()
PickerLaunchResult.Launched
} catch (failure: ActivityNotFoundException) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route Android security rejections through onError

On managed or vendor-customized Android devices where an intent handler exists but platform policy rejects its launch, ActivityResultLauncher.launch can throw SecurityException rather than ActivityNotFoundException. This helper lets that exception escape the launcher synchronously, bypassing the new onError callback and leaving the pending picker metadata set; the analogous directory and saver launch helpers have the same gap. Normalize this operational rejection as the appropriate FileKit exception, as the camera launcher already does.

AGENTS.md reference: AGENTS.md:L30-L32

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39431d0b53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

continuation.invokeOnCancellation { dialog.dispose() }
continuation.invokeOnCancellation { dialog.dispose() }
}
} catch (failure: HeadlessException) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize AWT display connection failures

When LinuxFilePicker selects the AWT fallback because XDG is unavailable and the JVM is not marked headless but cannot connect to the configured display server, initializing or showing FileDialog can throw java.awt.AWTError rather than HeadlessException. This catch misses that environmental failure, so the new Compose launcher propagates it instead of invoking onError with FileKitPickerException; normalize this AWT display failure alongside the headless case.

AGENTS.md reference: AGENTS.md:L30-L32

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: abb11bb597

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

operation: suspend () -> T,
): T = try {
operation()
} catch (failure: HeadlessException) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Catch Swing display connection failures

When XDG is unavailable, LinuxFilePicker routes directory selection through this Swing path; on a JVM that is not marked headless but cannot connect to the configured X11/Wayland display, constructing or showing JFileChooser can throw AWTError. This wrapper catches only HeadlessException, so the raw error bypasses the new FileKitDialogException/Compose onError contract. Catch and normalize AWTError here as the AWT picker and saver paths already do.

Useful? React with 👍 / 👎.

@vinceglb
vinceglb merged commit 332227b into main Aug 8, 2026
11 checks passed
@vinceglb
vinceglb deleted the improve-launcher-error branch August 8, 2026 20:43
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.

1 participant