Repository navigation
Add --dry-run - #244
Merged
Merged
Add --dry-run#244
Conversation
Prints the detected fields and the exact payload each cycle would send,
then exits without connecting to Discord. "Why is my GPU not showing" goes
from a back-and-forth to a paste.
A dry run is only worth anything if it builds what the real loop builds,
and the payload mapping was written out twice already - once inline in the
main loop, once in scripts/validate.py, and they had already drifted
(validate.py uses time.time() where the loop uses psutil.boot_time()).
So this pulls the mapping into one resolve_cycle() in presence.py that the
loop, --dry-run and validate.py all go through. Cycle.update keeps its
signature, so nothing about the sending path changes.
Output on my Windows 10 box, lightly trimmed:
=== Would send ===
cycle: hardware client_id=741099939198926920
state 'Intel(R) Arc(TM) B580 Graphics'
details '15,66 GB / 63,69 GB'
large_image 'big'
large_text '13th Gen Intel(R) Core(TM) i5-13600K'
small_image 'intel'
small_text 'Intel(R) Arc(TM) B580 Graphics'
Worth saying what that output is already good for: on this machine one
--dry-run shows the resolution field carrying a PowerShell error string,
the os and host cycles sending small_image 'unknown' with small_text
'Not Found', and the host line reading as a bare vendor. Three separate
reports that currently need three separate round trips.
Tested that it never constructs a Presence, since being safe to run with
Discord closed is the whole point.
Three combinations rather than either side winning: - args.py: keep master's --install-startup group and add --dry-run after it. - presence.py: resolve_cycle/ResolvedCycle sit alongside master's placeholder handling in build_presence_activity, so a dry run shows exactly what the loop would send - tooltip dropping included. - __main__.py: the loop keeps master's snapshot-once-per-rotation hoist and reads it through _resolve(), so both the perf fix and the shared resolution survive. get_component_id moved out of __main__ into presence.resolve_cycle, so the snapshot-once test now patches it where it lives. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WB6HG4WLukGEjhcq8FZJ7A
cursor Bot
pushed a commit
to nyannoying1337/FetchCord
that referenced
this pull request
Sep 11, 2026
Resolve conflicts with fetchcord#244 (--dry-run) by keeping both features: pause_when and dry-run are adjacent additions to args, __main__, and tests. Also point the pause loop test at presence.get_component_id after the resolve_cycle refactor on master. Co-authored-by: BlivionIaG <BlivionIaG@users.noreply.github.com>
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.
From the Discord list.
Prints the detected fields and the exact payload each cycle would send, then exits without connecting to Discord. "Why is my GPU not showing" goes from a back-and-forth to a paste.
On the refactor in here: a dry run is only worth anything if it builds what the real loop builds, and the payload mapping was already written out twice - once inline in the main loop, once in
scripts/validate.py. They had already drifted (validate.pyusestime.time()where the loop usespsutil.boot_time()). Rather than add a third copy, this pulls the mapping into oneresolve_cycle()inpresence.pythat the loop,--dry-runandvalidate.pyall go through.Cycle.updatekeeps its signature, so nothing about the sending path changes.Output on my Windows 10 box, trimmed:
Worth saying what that output is already good for: on this machine one
--dry-runshows theresolutionfield carrying a PowerShell error string (#235), theosandhostcycles sendingsmall_image 'unknown'withsmall_text 'Not Found'(#242), and the host line reading as a bare vendor (#243). Three separate reports that currently take three separate round trips.There's a test that it never constructs a
Presence- being safe to run with Discord closed is the whole point.Light overlap with #242, which also touches
presence.py(different function). Whichever lands first, I'll rebase the other.