Skip to content

Commit 661a705

Browse files
authored
fix: channel_ids should continue being represented in hyphenated format (#561)
as they already are in the channel_id column and in chidmessageid Closes: SYNC-4076
1 parent 356f24c commit 661a705

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

autopush-common/src/db/bigtable/bigtable_client/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ fn to_string(value: Vec<u8>, name: &str) -> Result<String, DbError> {
103103
/// Create a normalized index key.
104104
fn as_key(uaid: &Uuid, channel_id: Option<&Uuid>, chidmessageid: Option<&str>) -> String {
105105
let mut parts: Vec<String> = Vec::new();
106-
parts.push(uaid.simple().to_string());
106+
parts.push(uaid.as_simple().to_string());
107107
if let Some(channel_id) = channel_id {
108-
parts.push(channel_id.simple().to_string());
108+
parts.push(channel_id.as_hyphenated().to_string());
109109
} else if chidmessageid.is_some() {
110110
parts.push("".to_string())
111111
}
@@ -1303,7 +1303,7 @@ mod tests {
13031303
let chid = Uuid::parse_str(TEST_CHID).unwrap();
13041304
let chidmessageid = "01:decafbad-0000-0000-0000-0123456789ab:Inbox";
13051305
let k = as_key(&uaid, Some(&chid), Some(chidmessageid));
1306-
assert_eq!(k, "deadbeef0000000000000123456789ab#decafbad0000000000000123456789ab#01:decafbad-0000-0000-0000-0123456789ab:Inbox");
1306+
assert_eq!(k, "deadbeef0000000000000123456789ab#decafbad-0000-0000-0000-0123456789ab#01:decafbad-0000-0000-0000-0123456789ab:Inbox");
13071307
}
13081308

13091309
#[actix_rt::test]

autopush-common/src/db/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub struct NotificationRecord {
246246
#[serde(skip_serializing_if = "Option::is_none")]
247247
headers: Option<NotificationHeaders>,
248248
/// This is the acknowledgement-id used for clients to ack that they have received the
249-
/// message. Some Python code refers to this as a message_id. Endpoints generate this
249+
/// message. Autoendpoint refers to this as a message_id. Endpoints generate this
250250
/// value before sending it to storage or a connection node.
251251
#[serde(skip_serializing_if = "Option::is_none")]
252252
updateid: Option<String>,

autopush-common/src/notification.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use uuid::Uuid;
77
use crate::util::ms_since_epoch;
88

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

0 commit comments

Comments
 (0)