Skip to content

Shared-file ED2K published column shows a false `No` after publish-state reset

Historical reference only: stale-v0.72a-experimental-clean and analysis\stale-v0.72a-experimental-clean are retired reference sources, not active branch targets or current baselines. Use them only as provenance or idea-extraction sources; landed status is determined against main. See Historical References.

Summary

The shared-file publish-state UI carried an acknowledged correctness bug.

During the publish/reset path, CSharedFileList clears CKnownFile::m_PublishedED2K before the next successful publish cycle, and the Shared Files UI reads that flag directly. The visible result is a false No in the eD2K|Kad column until the file is shared again.

Evidence In Current Tree

  • srchybrid/SharedFileList.cpp:859
  • pFile->SetPublishedED2K(false);
  • the inline comment immediately acknowledges that this produces the wrong listview value until the file is shared again
  • srchybrid/KnownFile.h:89
  • GetPublishedED2K() exposes the raw boolean with no transitional state
  • srchybrid/SharedFilesCtrl.cpp:1029
  • the published-state icon path uses GetPublishedED2K() directly
  • srchybrid/SharedFilesCtrl.cpp:1089
  • the text shown in the eD2K|Kad column formats Yes/No directly from that flag

User-Visible Impact

  • the Shared Files list can show No for ED2K publishing even though the file is still in the republish workflow
  • column sorting/filtering based on that field is temporarily wrong
  • the comment has survived into multiple descendant trees, which means the bug remained accepted rather than fixed

This is primarily a correctness/UI-state bug. It does not look like a wire-level protocol failure.

Cross-Variant Status

The same acknowledged bug is present in all reviewed trees:

  • workspaces\v0.72a\app\eMule-main\srchybrid\SharedFileList.cpp:859
  • analysis\emuleai\srchybrid\SharedFileList.cpp:1027
  • analysis\stale-v0.72a-experimental-clean\srchybrid\SharedFileList.cpp:987

No reviewed analysis tree contained a completed fix for this specific state bug.

Resolution

Current main keeps the last visible ED2K published state during a refresh in app commit 10a6c20 and tracks the republish requirement with a transient CKnownFile pending flag. CSharedFileList::SendListToServer() includes pending files in the next offer packet and clears the pending flag after packet inclusion.

ClearED2KPublishInfo() still clears both visible and pending state for a real full publish reset.

Implemented Fix Shape

The fix stops treating "publish pending / publish reset" as "definitively not published."

It uses the explicit transitional state for "publish refresh pending" while leaving the Shared Files icon/text path on the visible published-state flag.

Validation Target

  • trigger the republish/reset path for one shared file
  • verify the eD2K|Kad column does not flip to a false No
  • verify sort order and icon state remain consistent during the transition
  • verify real unpublish still shows No