Skip to content

Commit

Permalink
fix: channel_ids should continue being represented in hyphenated form…
Browse files Browse the repository at this point in the history
…at (#561)

as they already are in the channel_id column and in chidmessageid

Closes: SYNC-4076
  • Loading branch information
pjenvey committed Jan 19, 2024
1 parent 356f24c commit 661a705
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions autopush-common/src/db/bigtable/bigtable_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ fn to_string(value: Vec<u8>, name: &str) -> Result<String, DbError> {
/// Create a normalized index key.
fn as_key(uaid: &Uuid, channel_id: Option<&Uuid>, chidmessageid: Option<&str>) -> String {
let mut parts: Vec<String> = Vec::new();
parts.push(uaid.simple().to_string());
parts.push(uaid.as_simple().to_string());
if let Some(channel_id) = channel_id {
parts.push(channel_id.simple().to_string());
parts.push(channel_id.as_hyphenated().to_string());
} else if chidmessageid.is_some() {
parts.push("".to_string())
}
Expand Down Expand Up @@ -1303,7 +1303,7 @@ mod tests {
let chid = Uuid::parse_str(TEST_CHID).unwrap();
let chidmessageid = "01:decafbad-0000-0000-0000-0123456789ab:Inbox";
let k = as_key(&uaid, Some(&chid), Some(chidmessageid));
assert_eq!(k, "deadbeef0000000000000123456789ab#decafbad0000000000000123456789ab#01:decafbad-0000-0000-0000-0123456789ab:Inbox");
assert_eq!(k, "deadbeef0000000000000123456789ab#decafbad-0000-0000-0000-0123456789ab#01:decafbad-0000-0000-0000-0123456789ab:Inbox");
}

#[actix_rt::test]
Expand Down
2 changes: 1 addition & 1 deletion autopush-common/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ pub struct NotificationRecord {
#[serde(skip_serializing_if = "Option::is_none")]
headers: Option<NotificationHeaders>,
/// This is the acknowledgement-id used for clients to ack that they have received the
/// message. Some Python code refers to this as a message_id. Endpoints generate this
/// message. Autoendpoint refers to this as a message_id. Endpoints generate this
/// value before sending it to storage or a connection node.
#[serde(skip_serializing_if = "Option::is_none")]
updateid: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion autopush-common/src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use uuid::Uuid;
use crate::util::ms_since_epoch;

#[derive(Serialize, Default, Deserialize, Clone, Debug)]
/// A Publishable Notification record. Thi is a notofication that is either
/// A Publishable Notification record. This is a notification that is either
/// received from a third party or is outbound to a UserAgent. If the
/// UserAgent is not currently available, it may be stored as a
/// [crate::db::NotificationRecord]
Expand Down

0 comments on commit 661a705

Please sign in to comment.