Attribute non-SFI READ/UPDATE to the selected file even without a content decoder
mobileid_activate_setpin_resetpin_20201222 regression: UPDATE BINARY
(plain offset addressing) after an SMS-PP DOWNLOAD / proactive group
showed "Writes: —" in the map view, although selection tracking kept
EF_SMSS selected the whole time.
Root cause: the sel-based branch only emitted result['file'] when
_decode_file_data() produced content — files without a registered
content decoder (EF_SMSS 6F43) silently lost attribution. The first
write only displayed via the frontend's SELECT-note fallback, which
masked the bug until a proactive group split the RW run.
Fix: decouple attribution from content decoding in both the command
branch and the GET RESPONSE branch — when the selected file has no
content decoder (or the offset is non-zero, where content decode is
intentionally skipped), emit {fid, ef} so the map, list, and detail
views always name the file. Content decoders still take priority.
Session 63 now decodes all three UPDATE BINARY ops as ADF/EF_SMSS.
Tests: +4 TestFileAttribution, one expectation updated to the new
contract — 342 total. Version 1.16.1, SW cache v23.
This commit is contained in:
1 parent
ac7519499a
commit
4541cc66c5
7 files changed
+72
-12
No files matched your search
@@ -3858,13 +3858,22 @@ def decode_message(raw_data, prev=None):
|
||||
result['file'] = {'sfi': rec_sfi, 'unknown': True, 'ef': f'SFI {rec_sfi}'}
|
||||
elif ins in (0xB0, 0xB2, 0xD6, 0xDC) and prev and prev.get('sel'):
|
||||
offset = p1p2.get('offset', 0)
|
||||
if ins in (0xB2, 0xDC) or offset == 0:
|
||||
if ins in (0xB2, 0xDC) and not _is_record_file(prev['sel']):
|
||||
result['file'] = _stale_file_note(prev['sel'])
|
||||
else:
|
||||
if ins in (0xB2, 0xDC) and not _is_record_file(prev['sel']):
|
||||
result['file'] = _stale_file_note(prev['sel'])
|
||||
else:
|
||||
file_dec = None
|
||||
if ins in (0xB2, 0xDC) or offset == 0:
|
||||
file_dec = _decode_file_data(prev['sel']['fid'], body, p1=p1)
|
||||
if file_dec:
|
||||
result['file'] = file_dec
|
||||
if file_dec:
|
||||
result['file'] = file_dec
|
||||
else:
|
||||
# Known file, no content decoder (or non-zero offset) —
|
||||
# still attribute the operation to the selected file.
|
||||
result['file'] = {
|
||||
'fid': prev['sel']['fid'],
|
||||
'ef': KNOWN_FIDS.get(prev['sel']['fid'],
|
||||
prev['sel']['fid'].upper()),
|
||||
}
|
||||
|
||||
# SW
|
||||
if sw_bytes:
|
||||
@@ -3884,6 +3893,13 @@ def decode_message(raw_data, prev=None):
|
||||
file_dec = _decode_file_data(prev['sel']['fid'], remaining[:cmd_body_len])
|
||||
if file_dec:
|
||||
result['file'] = file_dec
|
||||
else:
|
||||
# Known file, no content decoder — attribute anyway.
|
||||
fid = prev['sel']['fid']
|
||||
result['file'] = {
|
||||
'fid': fid,
|
||||
'ef': KNOWN_FIDS.get(fid, fid.upper()),
|
||||
}
|
||||
elif prev_ins == 0xA2 and prev.get('sel') and prev.get('file_ok'):
|
||||
if not _is_record_file(prev['sel']):
|
||||
result['file'] = _stale_file_note(prev['sel'])
|
||||
|
||||
Reference in new issue
Block a user