fix(dfm-mount): stop GMountOperation signal emission to prevent premature UNHANDLED reply - #391
Merged
deepin-bot[bot] merged 1 commit intoSep 8, 2026
Conversation
…ture UNHANDLED reply Root cause: gio's GMountOperation default class handlers (G_SIGNAL_RUN_LAST) schedule an idle reply of G_MOUNT_OPERATION_UNHANDLED after instance handlers return. On first-time SFTP login, gvfs sends ask-question (host key) followed by ask-password. The stale UNHANDLED idle queued by the question stage may still be pending when the AskPassword DBus call is dispatched (priority race: G_PRIORITY_DEFAULT dispatch vs G_PRIORITY_DEFAULT_IDLE idle); it then fires inside the modal password dialog's nested event loop, completes the pending AskPassword invocation as handled=FALSE, and gvfs fails the mount with "Password dialog cancelled" (密码对话框被取消) — reproducible when the UI is busy/event-starved on the password dialog, exactly matching the reported first-login SFTP mount failure. Fix: call g_signal_stop_emission_by_name() in both mountByGvfsAskQuestion and mountByGvfsAskPasswd, same as gvfs' own client implementation (gmountsource.c op_ask_password/op_ask_question). All reply paths already call g_mount_operation_reply explicitly, so stopping the default handler is safe. Verified with a minimal gio reproducer against a local SFTP server: - busy mode (stale idle + nested dialog loop): mount fails with "密码对话框被取消" (G_IO_ERROR_FAILED_HANDLED) before the fix - with stop_emission: mount succeeds under identical conditions Log: 修复首次登录挂载sftp点击仍然登录后提示挂载失败密码对话框被取消 Influence: sftp/ftp/smb 挂载过程中密码与主机密钥确认对话框交互不再被 gio 默认处理器竞态打断 Bug: https://pms.uniontech.com/bug-view-376305.html Change-Id: I1f9e2d6c4b7a48e3952f0a1d8e6c5b3a7f2d4e8c
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates GVFS question and password handlers to stop GMountOperation’s default signal emission, preventing stale idle UNHANDLED responses from racing with SFTP authentication dialogs and causing first-time mounts to fail as cancelled. Sequence diagram for preventing premature SFTP mount cancellationsequenceDiagram
participant GVFS
participant GMountOperation
participant DNetworkMounter
participant Dialog as AuthenticationDialog
GVFS->>GMountOperation: emit ask-question or ask-password
GMountOperation->>DNetworkMounter: mountByGvfsAskQuestion() / mountByGvfsAskPasswd()
DNetworkMounter->>GMountOperation: g_signal_stop_emission_by_name()
DNetworkMounter->>Dialog: show host-key or password dialog
Dialog-->>DNetworkMounter: explicit reply
DNetworkMounter-->>GVFS: handled reply
Note over GMountOperation,GVFS: Default UNHANDLED idle is not scheduled
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: blocked) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #389 to master.
Cherry-pick of commit 8081779 to the master branch.
Changes: In
src/dfm-mount/private/dnetworkmounter.cpp, addg_signal_stop_emission_by_name()calls at the entry ofmountByGvfsAskQuestionandmountByGvfsAskPasswdto prevent premature UNHANDLED reply when mounting SFTP for the first time.Compilation verified:
cmake -B build -DCMAKE_BUILD_TYPE=Release+cmake --build build --target dfm6-mountpasses with no new errors or warnings.Summary by Sourcery
Bug Fixes: