Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replies to Fitness.app messages are annotated with an error because they do not have a payload #212

Open
ReagentX opened this issue Nov 24, 2023 · 0 comments
Assignees
Labels
bug Something isn't working crate: database Related to the database crate exporter Related to exporter processes table Related to table data

Comments

@ReagentX
Copy link
Owner

ReagentX commented Nov 24, 2023

The message body is parsed correctly, but the messages are annotated with an error message because imessage-exporter looks for a payload that doesn't exist. This is partially related to #28.

The kIMTranscriptPluginBreadcrumbTextReceiverIdentifier data is still in the attributedBody, so it is possible to detect these messages. For example:

/// `true` if the message is from Fitness.app, else `false`
pub fn is_fitness(&self, db: &Connection) -> bool {
    matches!(self.variant(), Variant::App(CustomBalloon::Fitness)) || {
        if let Some(body) = self.attributed_body(db) {
            return String::from_utf8_lossy(&body).contains(FITNESS_RECEIVER);
        } else {
            false
        }
    }
}

Affected messages are sent by the database owner from Apple Watch as reactions to Fitness.app friends completing workouts. Apple provides some detail on how these messages get sent here.

This is a problem because these types of "replies" actually send two messages: the first is an a normal message that contains the friend's Fitness accomplishment and the second is a 2-part message that contains the chosen response and a U+FFFD char, which indicates an App payload. However, since the messages are sent separately, and the message with the U+FFFD does not have a payload, imessage-exporter emits the error.


The first message contains an associated_message_guid that points to the second. This query returns all of the top-level Fitness messages:

SELECT * FROM message WHERE associated_message_guid NOT NULL AND associated_message_type = 3 AND balloon_bundle_id is NULL;

imessage-exporter does a better job of Messages.app at displaying these types of messages.

From Message.app:

image

From imessage-exporter:

image image

The rest of the exported data is correct, but the error should not be present.

@ReagentX ReagentX added bug Something isn't working crate: database Related to the database crate labels Nov 24, 2023
@ReagentX ReagentX self-assigned this Nov 24, 2023
@ReagentX ReagentX changed the title Replies to Fitness.app messages are not detected because they do not have a Bundle ID Replies to Fitness.app messages are annotated with an error because they do not have a Bundle ID Nov 24, 2023
@ReagentX ReagentX added exporter Related to exporter processes table Related to table data labels Nov 24, 2023
@ReagentX ReagentX changed the title Replies to Fitness.app messages are annotated with an error because they do not have a Bundle ID Replies to Fitness.app messages are annotated with an error because they do not have a payload Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crate: database Related to the database crate exporter Related to exporter processes table Related to table data
Projects
None yet
Development

No branches or pull requests

1 participant