Skip to content

fix: clean up stale miner data when hotkey re-links to new GitHub account#340

Merged
anderdc merged 2 commits intoentrius:testfrom
tmimmanuel:fix/cleanup-stale-miner-data-reverse
Apr 9, 2026
Merged

fix: clean up stale miner data when hotkey re-links to new GitHub account#340
anderdc merged 2 commits intoentrius:testfrom
tmimmanuel:fix/cleanup-stale-miner-data-reverse

Conversation

@tmimmanuel
Copy link
Copy Markdown
Contributor

@tmimmanuel tmimmanuel commented Apr 3, 2026

Summary

  • Existing cleanup only handled one direction: same github_id re-registering on a new (uid, hotkey)
  • Missing the reverse: same (uid, hotkey) linking to a new github_id — old GitHub's rows were never deleted
  • This caused duplicate entries (e.g. madelyngamble2) showing stale data with same $/day but 0 score
  • Added three reverse cleanup queries (CLEANUP_STALE_*_BY_HOTKEY) and call them in cleanup_stale_miner_data()

Scenario

  1. User registers madelyngamble2, links wallet, gets hotkey
  2. User stops mining with madelyngamble2
  3. User registers spider-yamet with the same wallet/hotkey
  4. Old entry for madelyngamble2 is never cleaned up → duplicate in UI

Related entrius/gittensor-ui#124
spider-yamet
madelyngamble2

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 7, 2026

just merged big changes into test please fix conflicts thanks

@tmimmanuel tmimmanuel force-pushed the fix/cleanup-stale-miner-data-reverse branch from 7fdfa41 to 544b6df Compare April 7, 2026 04:15
@tmimmanuel
Copy link
Copy Markdown
Contributor Author

@anderdc I resolved merge conflicts, plz review.

@anderdc anderdc merged commit cbb4956 into entrius:test Apr 9, 2026
4 checks passed
anderdc added a commit that referenced this pull request Apr 10, 2026
…ount (#340)

Co-authored-by: Ander <61125407+anderdc@users.noreply.github.com>
@anderdc anderdc mentioned this pull request Apr 10, 2026
anderdc added a commit that referenced this pull request Apr 10, 2026
…ount (#340)

Co-authored-by: Ander <61125407+anderdc@users.noreply.github.com>
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