Skip to content

Fix: Cherry-pick upstream crash and stability fixes (upstream fixes from Nov 29 – Dec 3) - #19241

Closed
MemerGamer wants to merge 738 commits into
files-community:mainfrom
MemerGamer:fix/upstream-picks-1205
Closed

MemerGamer wants to merge 738 commits into
files-community:mainfrom
MemerGamer:fix/upstream-picks-1205

Conversation

@MemerGamer

Copy link
Copy Markdown

Resolved / Related Issues

Implements the LinuxFiles backlog item "Cherry-pick useful upstream Files changes selectively" (see docs/linux-port/upstream-policy.md). This PR selectively brings over 8 upstream bug fixes that apply to cross-platform code this fork still has.

Cherry-picked commits (cherry-pick -x, attribution preserved)

Upstream SHA Fix Why it matters on Linux
c8446888d (#19210) Crash when closing a tab while it was navigating ContentPage! null-forgiving deref in ModernShellPage — closing a tab mid-navigation crashes; same code lives in this fork
98e3fa2eb (#19224) Crash when a column in the Columns layout was still loading Null-unsafe SingleOrDefault(x => x!.IsCurrentInstance) in ColumnsLayoutPage — same race exists in the fork
b7b827a55 (#19223) Crash when updating the toolbar without an active pane ActivePaneOrColumn! deref in MainPage.UpdateNavToolbarProperties — pane-less states occur on Linux too (e.g. during sidebar collapse)
7f4a9e3c4 (#19222) Crash when switching the Omnibar to search mode after its tab was closed InstanceViewModel may be null after tab close; fork's NavigationToolbar has the identical code
93b8e45b9 (#19205) Crash when pressing Enter with multiple files selected Command executed inline inside the key handler could re-enter UI updates; moved to DispatcherQueue.TryEnqueue. Identical handler in the fork's MainPage
0716e96e6 (#19206) Crash when renaming conflicting items while copying or moving FilesystemHelpers iterated a lazy Zip sequence while the conflict resolution mutated it; .ToList() snapshots it. Core cross-platform file-ops path
4af9a43b7 (#19211) Exception when activating Files while a Columns tab was loading GetRequiredPaneHolder() throws when no shell page exists yet during window activation; replaced with the same null-safe chain MainPage already uses
d61502929 (#19212) Crash when a closed tab finished navigating or loading Dispose() disposed filterDebounceCS/addFilesCTS that fire-and-forget work still reads (the fork's own watcherCTS comment describes this exact bug class)

All 8 are in shared view-model / view / helper code (no Windows-only APIs touched); each applied cleanly with no conflicts.

Considered and skipped

Steps used to test these changes

  1. Verified each upstream diff against the fork's current code before picking; all touched paths exist here with matching context
  2. All 8 cherry-picks applied with zero conflicts; git diff --check clean
  3. Checked the null-safe patterns introduced mirror code already present in the fork (e.g. ShellPage?.PaneHolder?.FocusActivePane() in MainPage)
  4. No local full-app build (per project policy); compile and Linux CI checks are exercised by Files CI on this PR

Remaining limitations

  • UI behavior of the picks was not manually exercised locally; CI + review cover compile-level correctness, runtime behavior rides on upstream's own testing of the same changes
  • Upstream commits after the pick window (Dec 3+) and UX-level fixes are intentionally left out

🤖 Generated with GLM via pi

MemerGamer and others added 30 commits October 10, 2026 11:31
Co-Authored-By: GPT-6.1-sol (OpenAI Codex) <noreply@openai.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Code Quality: Plan Rust backend and Windows code removal
Code Quality: Point Nix package at alpha3
Co-Authored-By: GPT-6.1-sol (OpenAI Codex) <noreply@openai.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Co-Authored-By: GPT-6.1-sol (OpenAI Codex) <noreply@openai.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Co-Authored-By: GPT-6.1-sol (OpenAI Codex) <noreply@openai.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Code Quality: Measure Rust directory scanning against optimized C#
Fix: Update existing upstream sync branches and PRs
# Conflicts:
#	.github/workflows/sync-upstream.yml
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Snapshot command state on the UI thread, build and filter the menu model
on a worker, then create the flyout on the UI thread. A newer menu request
cancels the previous build. Also skip the per-item ContainerFromItem theme
pass when many items are selected at once.

Headless 10k fixture: file/folder menu UI block 150-175 ms -> under 25 ms;
select-all stall 817 -> ~620 ms (Uno SelectedItems.Add stays O(n^2)).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Co-Authored-By: GPT-6.1-sol (OpenAI Codex) <noreply@openai.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Fix: Preserve tags when xattr writes fail
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: GPT-6.1-sol (OpenAI Codex) <noreply@openai.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Code Quality: Add Windows path allowlist and prune helper for upstream sync
Fix: Build context menus off the UI thread
Co-Authored-By: GPT-6 (OpenAI Codex) <noreply@openai.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Code Quality: Sync upstream Files (2026-10-12)
Remove leaf Windows projects, Windows CI/MSIX packaging, the upstream sync
workflow and prune tooling; document the independent-fork policy.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Code Quality: Detach from upstream Files (stage 1: remove Windows projects, CI, sync)
Mechanical: keep the non-Windows branch of every #if WINDOWS / #if !WINDOWS,
delete 70 *.Windows.cs partials.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq
MemerGamer and others added 27 commits December 3, 2026 09:12
Co-Authored-By: GPT-6.2-sol (OpenAI Codex) <noreply@openai.com>
Code Quality: Update the Nix flake to 0.1.0-alpha9
Repair restrictive fallback directory and lock modes using verified descriptors. Preserve files that occupy the socket pathname and bound D-Bus name acquisition so a stalled bus cannot hang startup.

Co-Authored-By: GPT-6.2-sol (OpenAI Codex) <noreply@openai.com>
A restrictive umask can turn the intended public directory into a private directory. Apply the mode explicitly so the test exercises the refusal on every launch.

Co-Authored-By: GPT-6.2-sol (OpenAI Codex) <noreply@openai.com>
…ning

Fix: Recover private Linux single-instance endpoints
Check the descriptor-relative socket address while preserving endpoint names. Distinguish invalid directory components in diagnostics and retry interrupted directory calls. Cover long runtime directories, alias resolution and unavailable procfs.

Co-Authored-By: GPT-6.2-sol (OpenAI Codex) <noreply@openai.com>
Return the final errno after four interrupted attempts so callers can take their existing error paths. Verify that missing procfs skips fallback directory creation.

Verified 46 single-instance and D-Bus tests under umask 077.

Co-Authored-By: GPT-6.2-sol (OpenAI Codex) <noreply@openai.com>
The location row template defines two columns but placed the path text in
the non-existent column 2. Use column 1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ShowProgressRing was a cached flag that was set as a side effect of reading
HasAnyItemInProgress and only refreshed when the flyout opened, so it stayed
true after a failed item was dismissed. Compute it from the current state and
raise it from NotifyChanges.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds Files.Platform.MacOS and the Files.App wiring needed to build and start
the Skia desktop app on macOS (AppKit backend). The macOS code lives in new
*.MacOS.cs files and the new project; the few shared call sites that were
Linux-only are routed through DESKTOP_MACOS branches. Linux code paths are
unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…wups

Fix: Refine Linux single-instance socket fallback
Fix: Library properties location list column
Fix: stale progress ring left by the status center
Feature: macOS desktop head that builds and starts
ShowDotFiles defaulted to true, so includeHidden was always true and dot-prefixed
items were listed (dimmed) even with "Show hidden files" off. Default it to false
so dotfiles are hidden unless the user opts in. Saved values are kept.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The D-Bus connect (up to 3 s) ran before the 5 s election clock started,
so worst-case startup could take about 8 s. One stopwatch now starts at
the beginning of TryBecomePrimaryAsync and is shared by the connect, the
bus election and the socket election. The connect gets min(3 s, time left);
if nothing is left, D-Bus is skipped and startup falls back as before.

Tests: new SingleInstanceBudgetTests use an injectable bus connector and
election budget to show the connect timeout is capped and that a slow
connect leaves the election only the remaining time.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fix: keep the D-Bus connect inside the single-instance budget
@CLAassistant

CLAassistant commented Dec 5, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 3 committers have signed the CLA.

✅ yair100
❌ MemerGamer
❌ lextm
You have signed the CLA already but the status is still pending? Let us recheck it.

@MemerGamer MemerGamer closed this Dec 5, 2026
@MemerGamer
MemerGamer deleted the fix/upstream-picks-1205 branch December 5, 2026 15:30
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.

7 participants