mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-07-06 01:41:07 +02:00
fix(ui): multi-byte path rendering across contact list, DM modal, retry
Same root cause as the previous console fix: meshcore lib 2.x stores out_path_len as the masked hop count and out_path_hash_mode separately. Several UI surfaces and the DM retry logic were still decoding the hash-size mode from the upper bits of out_path_len, which always yields 1 for in-memory contact data and silently truncates multi-byte paths. Fixed sites: - /api/contacts/detailed: path_or_mode and outgoing payload now use out_path_hash_mode; the field is included in /api/contacts too. - dm.js: Contact Info modal computes hashSize for the import button from out_path_hash_mode. - console "contacts" command: same correction as "path". - device_manager._paths_match / _extract_path_hex: accept hash mode as a parameter; callers (_dm_retry_task, _delayed_path_backfill, Phase 2 rotation dedup) pass contact.out_path_hash_mode. - PATH event handlers: derive hash_size from path_hash_mode instead of decoding it from an already-masked path_len.
This commit is contained in:
+3
-2
@@ -1057,8 +1057,9 @@ function populateContactInfoModal() {
|
||||
} else {
|
||||
const hops = mode.split('→').length;
|
||||
const outPathLen = contact.out_path_len || 0;
|
||||
const hashSize = outPathLen > 0 ? ((outPathLen >> 6) + 1) : 1;
|
||||
const hopCount = outPathLen & 0x3F;
|
||||
const hashMode = contact.out_path_hash_mode;
|
||||
const hashSize = (Number.isInteger(hashMode) && hashMode >= 0) ? hashMode + 1 : 1;
|
||||
const hopCount = outPathLen > 0 ? outPathLen : 0;
|
||||
const pathHex = contact.out_path ? contact.out_path.substring(0, hopCount * hashSize * 2) : '';
|
||||
|
||||
div.innerHTML = `
|
||||
|
||||
Reference in New Issue
Block a user