Skip to content

Commit f9d84fa

Browse files
Fake deserializing >2**31 issue comment IDs
We have recently hit larger IDs in production, this tries to temporarily work around that by making use of the negative ID space, hopefully buying us a good chunk of time to make the larger change to switch to 2**64 IDs. Since the conversion is bidirectional, if not numeric value preserving, it should hopefully be OK.
1 parent 871d67c commit f9d84fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/github/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl Client {
208208
) -> DashResult<CommentFromJson> {
209209
let url = format!(
210210
"{}/repos/{}/issues/comments/{}",
211-
BASE_URL, repo, comment_num
211+
BASE_URL, repo, comment_num as u32
212212
);
213213
let payload = serde_json::to_string(&btreemap!("body" => text))?;
214214
Ok(self.patch(&url, &payload)?.error_for_status()?.json()?)

src/github/models.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl IssueFromJson {
104104

105105
#[derive(Debug, Deserialize)]
106106
pub struct CommentFromJson {
107-
pub id: i32,
107+
pub id: u32,
108108
pub html_url: String,
109109
pub body: String,
110110
pub user: GitHubUser,
@@ -141,7 +141,7 @@ impl CommentFromJson {
141141
.first::<i32>(&*conn)?;
142142

143143
Ok(IssueComment {
144-
id: self.id,
144+
id: self.id as i32,
145145
fk_issue: issue_id,
146146
fk_user: self.user.id,
147147
body: self.body.replace(0x00 as char, ""),

0 commit comments

Comments
 (0)