Repository navigation
fix: Stop offering to delete a module that is not the problem - #19
Merged
Merged
Conversation
Loading BRIDGE-MIB alongside MSTP-MIB raises a conflict, correctly: RFC 4188 puts `dot1dConformance` at 1.3.6.1.2.1.17.8 and the 802.1s draft MIB puts `mstpMib` there, so the two really do claim the same three OIDs under different names. But the dialog reporting it was the one written for two files declaring the same module, and it ended with "Choose which file to keep" and a button to delete each - which is the wrong answer twice over. Both modules are real, both are wanted, and a node is identified by its OID, so the tree shows them together whatever the user does. A conflict now records which kind it is. The same-module kind keeps the dialog it had, deletion and all. The shared-OID kind says what has happened, titles each entry with the OID rather than one of the two names - the OID is the subject, the names are what disagree - and offers nothing but Close. Conflicts recorded before the distinction existed have no kind, and they were all of the same-module sort, so they read as that. Checked in the browser both ways: the BRIDGE-MIB/MSTP-MIB pair now explains itself and cannot be "resolved" by deletion, and the TEST-CONFLICT-A/B fixtures still offer it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018qyesKa9si8szMUe7w8HNK
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.
Reported from a real load — the conflict dialog raised on
BRIDGE-MIB+MSTP-MIB, ending in "Choose which file to keep: Delete BRIDGE-MIB / Delete MSTP-MIB".The detection is right; the advice was not
The two files really do claim the same OIDs:
BRIDGE-MIB:dot1dConformance ::= { dot1dBridge 8 }MSTP-MIB(the 802.1s draft,REVISION "0412050000Z" … "Draft 1"):mstpMib ::= { dot1dBridge 8 }Both land on
1.3.6.1.2.1.17.8, and their children collide on.8.1and.8.1.1. That is a real thing worth telling someone about, and reporting it is what the cross-module OID check added in #16 is for.What was wrong is what the dialog then offered. It was the one written for the other kind of conflict — two files declaring the same module, where one is usually a stale copy and deleting it is the answer. Applied here it is wrong twice over: both modules are real and wanted, and deleting either resolves nothing, because a node is identified by its OID and the tree shows whatever is left exactly as before. The dialog was steering people into throwing away a MIB they need.
What changes
A conflict now records which kind it is (
kind: 'module' | 'oid').The banner under the header follows the same split, so "resolve" is not promised where there is nothing to resolve.
Conflicts recorded before the distinction existed carry no
kind. They were all of the same-module sort, so they read as that.Verification
Driven in a browser both ways:
BRIDGE-MIB+MSTP-MIB→ three entries titled by OID, the explanation above, no delete buttons (screenshot below).TEST-CONFLICT-A+TEST-CONFLICT-B→ still "Both files declare the same module…", still offers to delete either.194 tests pass, typecheck and build clean.
tests/rebuild.test.tsgains an assertion that the shared-OID conflict is taggedoid, since that tag is the only thing standing between a user and a needless deletion.🤖 Generated with Claude Code
https://claude.ai/code/session_018qyesKa9si8szMUe7w8HNK
Generated by Claude Code