Convert wireMessenger to LAVA @artifact_processor (+ forensic fix: stop writing to the source DB)#835
Merged
Merged
Conversation
…ixes)
Converts the three Wire Messenger artifacts (Profile, Contacts, Messages)
to the decorated pattern.
Forensic fix: the original get_wire_messages opened the evidence database
in WRITE mode and INSERTed/UPDATEd the Messages table to surface deleted
messages. This now reads MsgDeletion read-only and appends the deleted
entries (Message Type 'Deleted') without ever modifying the source DB.
Bug fixes: _user_id now guards against a missing preferences file (the old
code could pass None into re.match -> TypeError), and the SQLite-magic-byte
check actually runs (the original tested the lambda object, always truthy).
Profile picture migrates from media_to_html to ('Profile Picture','media')
via check_in_media. Timestamps become aware UTC datetimes. Reserved-word
column audit run (clean).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts the three Wire Messenger artifacts (Wire User Profile, Wire Contacts, Wire Messages) to the decorated
@artifact_processorpattern.get_wire_messages, whenMsgDeletionhad rows, opened the evidence database in write mode (sqlite3.connect) and ranINSERT INTO Messages+UPDATE Messagesto surface deleted messages — i.e. it modified the source evidence. This now readsMsgDeletionread-only and appends the deleted entries (Message Type =Deleted) in Python, never touching the source DB.Bug fixes
_user_idguards a missingcom.wire.preferences.xml(the old code could passNoneintore.match→TypeError).if is_sqlite3:), which is always truthy, so the validation was dead.Media migration: the profile picture moves from
media_to_htmlto('Profile Picture','media')viacheck_in_media.Other: timestamps → aware UTC
datetime; reserved-word column audit clean. Original author (@cf-eglendye) and dates (2024-04-24) preserved.