Skip to content

Clear the keyed-archiver deprecation warnings - #584

Merged
hannesa2 merged 1 commit into
gitx:masterfrom
goneng:clear-keyed-archiver-warnings
Aug 23, 2026
Merged

hannesa2 merged 1 commit into
gitx:masterfrom
goneng:clear-keyed-archiver-warnings

Conversation

@goneng

@goneng goneng commented Aug 23, 2026 •

Copy link
Copy Markdown
Collaborator

Move the drag-and-drop pasteboard payloads onto the secure-coding keyed
archiver API that replaced the entry points deprecated in 10.14, and
handle the failure the replacement reports rather than letting it fall-through.

  • Archive the file-change and ref drags requiring secure coding
  • Decode them through unarchivedObjectOfClass(es):fromData:error:
  • Name NSNumber alongside NSArray so the ref payload decodes fully
  • Refuse the drag when encoding or decoding fails

The last point matters beyond the warnings.
The previous API raised on malformed data, while the replacement returns nil, and
neither drop handler was written for a nil payload.
On the file-change side that would have reached objectsAtIndexes: with nil - and crashed;
on the ref side it was quieter and worse, since messaging nil yields an index of 0 and
the drop would have moved the wrong ref.
Both paths now log and return NO.

Warnings go from 69 to 65 in GitX's own sources.
The remainder come from the vendored ObjectiveGit and libgit2 headers and
are not addressable from this repository.

Test plan

  • xcodebuild test -only-testing:GitXTests passes 39/39 - unchanged
  • Clean build drops exactly the four intended warnings and adds none,
    (confirmed by diffing the deduplicated warning sets)
  • Exercised in a running build against a scratch repository:
    dragging a file from unstaged to staged and back,
    dragging a multiple-file selection, and
    dragging a branch label onto another commit,
    (which the reflog records as the expected ref update)
  • The round trip was also checked directly for both payload shapes,
    including the index set class a real table-view supplies, and a
    wrong allowed class was confirmed to return nil with an error
    rather than a partly-decoded object

@goneng
goneng force-pushed the clear-keyed-archiver-warnings branch from 82c0c27 to cd60813 Compare August 23, 2026 07:48
@goneng
goneng marked this pull request as ready for review August 23, 2026 09:40
Move the drag-and-drop pasteboard payloads onto the secure-coding
archiver API that replaced the pre-10.14 entry points, and handle the
failure the new API reports by returning instead of raising.

- Archive the file-change and ref drags requiring secure coding
- Decode them through unarchivedObjectOfClass(es):fromData:error:
- Name NSNumber alongside NSArray so the ref payload decodes fully
- Refuse the drag when encoding or decoding fails, which the previous
  API signalled by raising rather than by returning nil
@goneng
goneng force-pushed the clear-keyed-archiver-warnings branch from cd60813 to f6c8a17 Compare August 23, 2026 14:46
@hannesa2
hannesa2 merged commit 6368a61 into gitx:master Aug 23, 2026
3 checks passed
@goneng
goneng deleted the clear-keyed-archiver-warnings branch August 23, 2026 17:08
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