Skip to content

fix(protocols): restoring a protocol registration puts back the class, not the shipped ModuleDescriptor #1504

Closed

Description

@JarryShaw

Describe the bug
Registering a custom class over a shipped entry and then registering the shipped one back leaves the dispatch table holding the resolved class instead of the original descriptor.

Reproduction

from pcapkit.protocols.transport.tcp import TCP
shipped = TCP.__proto__[80]           # ModuleDescriptor(module='pcapkit.protocols.application.http', name='HTTP')
TCP.register(80, Custom); TCP.register(80, shipped)
TCP.__proto__[80] is shipped          # False: <class 'pcapkit.protocols.application.http.HTTP'>

Expected behavior
TCP.__proto__[80] is shipped, as the foundation registrars already guarantee (#1363, #1364).

System information
Linux, CPython 3.14.7, main at 00aa1fc90.

Additional context
Each protocol register resolves the descriptor: protocol.py:924, link/link.py:148, internet/internet.py:168, transport/transport.py:122, misc/pcap/frame.py:155, misc/pcapng.py:1027, transport/sctp.py:748 (all under pcapkit/protocols/). It affects all 9 module registrars.

Found by the #1202 foundation round-trip slice; reproduced on main.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 9, 2026
  2. JarryShaw commented on Oct 9, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until the #1202 foundation-slice test PR (branch test/1202-foundation-roundtrips) merges. That PR adds this defect's Gap row, and the fix must delete the row.

  3. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 9, 2026
  4. JarryShaw commented on Oct 9, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1508 has merged, so this defect's known-failure row is on main. A worker is on the fix, and the fix PR deletes the row.

  5. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 9, 2026
  6. JarryShaw commented on Oct 9, 2026

    @JarryShaw
    OwnerAuthor

    #1533 has merged: six of the seven restore sites now put back the shipped ModuleDescriptor, and the Gap(1504) row is narrowed to the 6 register_linktype/register_pcapng labels.

    The seventh site, PCAPNG.register at protocols/misc/pcapng.py:1021-1035, is still open. #1523 edits that file. Blocked until #1523 merges; the fix then applies the same seven lines as the other sites and deletes the Gap(1504) row.

  7. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 9, 2026
  8. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    Unblocking early to meet a deadline. A worker started from main (a3da376dd) on #1502, #1504 and #1558 together, since all three need pcapkit/protocols/misc/pcapng.py. It will rebase over #1523 when that merges, keeping every #1523 hunk.

  9. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 10, 2026
  10. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions