Skip to content

fix issues in gxstrans#308

Merged
csoler merged 1 commit into
RetroShare:masterfrom
jolavillette:fix/gxstrans
Jun 13, 2026
Merged

fix issues in gxstrans#308
csoler merged 1 commit into
RetroShare:masterfrom
jolavillette:fix/gxstrans

Conversation

@jolavillette

Copy link
Copy Markdown
Contributor
  1. ACK stamp - processRecvdMessages now advertises messages injected via receiveNewMessages (the GxsTrans receipt) to friends; without it the ACK never propagates back.
  2. notifyGxsTransSendStatus - break inside the if (x2): the linear search over msgOutgoing no longer bails out after the 1st bucket.
  3. notifyGxsTransSendStatus - it->first instead of msg_id (x2): the GUI event references the original message, not its per-recipient copy.
  4. notifyDataStatus - found flag instead of the premature return: same linear-search bug.
  5. checkOutgoingMessages - emits a change notification when the PENDING flag is cleared (GUI refresh).

@csoler csoler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • for debugging purpose you added a log of RsDbg(). That's fine, but you should use #ifdefs around (GROUTER_DEBUG, GXSTRANS_DEBUG, etc), so we can easily activate them service by service. For most debug blocks (some are large!) that actually helped you find the problem, just remove them.

Comment thread src/gxstrans/p3gxstrans.cc Outdated
<< "with: msgId: " << receipt->msgId << std::endl;
#endif

RsGxsTransId mailId = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire block is doing nothing except printing dbg info. Please use a ifdef around.

Comment thread src/grouter/p3grouter.cc Outdated

void p3GRouter::locked_collectAvailableFriends(const GRouterKeyId& gxs_id,const std::set<RsPeerId>& incoming_routes,uint32_t duplication_factor, std::map<RsPeerId,uint32_t>& friend_peers_and_duplication_factors)
{
return; // FORCE NO DIRECT FRIENDS AVAILABLE TO TEST TUNNEL FALLBACK ROUTING!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you do not want to keep that debugging hack.

Comment thread src/grouter/p3grouter.cc Outdated
{
if(mTurtle->isTurtlePeer(pid))
{
if (trans_item.PacketSubType() == RS_PKT_SUBTYPE_GROUTER_TRANSACTION_CHUNK)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, this blobk is for debug only and is fairly large. If temporary, jusr remove it.

Comment thread src/grouter/p3grouter.cc Outdated
}
else
{
if (trans_item.PacketSubType() == RS_PKT_SUBTYPE_GROUTER_TRANSACTION_CHUNK)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Comment thread src/grouter/p3grouter.cc Outdated

if(delete_entry)
{
if( it->second.data_status != RS_GROUTER_DATA_STATUS_DONE && it->second.data_status != RS_GROUTER_DATA_STATUS_RECEIPT_OK )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same. I won't comment on the remaining ones.

Comment thread src/gxs/rsgenexchange.cc Outdated
for(std::list<RsGxsMessageId>::const_iterator it(messages_to_reject.begin());it!=messages_to_reject.end();++it)
mNetService->rejectMessage(*it) ;

// MAIL: stamp the server-side msg update TS for groups that received new messages, so that friends

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're in rsgenexchange here so there's nothing specific to each service. Update the comment.

Comment thread src/gxs/rsgenexchange.cc
{
RsDbg() << "MAIL (" << AuthSSL::getAuthSSL()->getOwnLocation() << "): GXS - Stamping server msg update TS for group " << grpId
<< " after injecting new message(s) via receiveNewMessages() (e.g. GxsTrans ACK), so friends get notified and re-sync";
mNetService->stampMsgServerUpdateTS(grpId) ;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok this is probably where the problem happens. Good catch.

…o friends

When a GxsTrans message (e.g. a presigned ACK receipt) is re-injected on the
recipient side via RsGenExchange::receiveNewMessages(), it is stored but the
server-side message-update timestamp is never stamped - unlike the regular
netservice transaction path (processCompletedTransactions). As a result friends
are not notified and the message is not re-synced, so distant-mail ACKs can be
lost and the sender never sees the message as delivered.

- rsgenexchange: after storing, stamp the server msg-update TS for every group
  that received genuinely-new (post-deduplication) messages, off-mutex.
- p3msgservice: notifyDataStatus now scans all outgoing boxes before giving up
  (found-flag instead of returning on the first non-matching box);
  notifyGxsTransSendStatus flags the correct message id (it->first) and breaks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@csoler csoler merged commit aa8832f into RetroShare:master Jun 13, 2026
1 check failed
@jolavillette jolavillette deleted the fix/gxstrans branch June 14, 2026 18:21
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