Skip to content

Commit

Permalink
Fixes missing fields causing unexpected error in moderator views (#2432)
Browse files Browse the repository at this point in the history
Fixes #2431.
  • Loading branch information
dakota002 authored Jul 2, 2024
1 parent bb79dac commit 67bd135
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/routes/circulars.moderation.$circularId.$requestor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ function DiffedContent({
newString: string
method?: 'words' | 'lines'
}) {
const diff = methodMap[method ?? 'words'](oldString, newString)
const diff = methodMap[method && newString ? method : 'lines'](
oldString ?? '',
newString ?? ''
)

return (
<div>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/circulars/circulars.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export async function approveChangeRequest(
editedOn: Date.now(),
format: changeRequest.format,
submitter: changeRequest.submitter,
createdOn: changeRequest.createdOn,
createdOn: changeRequest.createdOn ?? circular.createdOn, // This is temporary while there are some requests without this property
})

await deleteChangeRequestRaw(circularId, requestorSub)
Expand Down
20 changes: 20 additions & 0 deletions sandbox-seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4727,6 +4727,16 @@
"submitter": "Ulisse Quadri at Bassano Bresciano Obs <oabb@ulisse.bs.it>",
"body": "U.Quadri, P.Madurini and L.Strabla (Bassano Bresciano Astronomical Observatory),\n\nMember of: \nAAVSO - American Association of Variable Star Observers.\nUAI/SSV - Unione Astrofili Italiani/sezione stelle variabili.\nGAC - Gruppo Astrofili Cremonesi.\n\nin a large collaboration with:\nM.G. Dainotti (National Astronomical Observatory of Japan), \nY. Niino (Tokyo University, Institute of Astronomy), \nK. Kalinowski (Aarhus University, Department of Physics and Astronomy),\nB. De Simone (Universita' degli Studi Di Salerno)\nreport: \n\nWe imaged the field of Swift J1727.8-1613(GRB 230824A) \n(Page et al., GCN 34537; Navaneeth et al., GCN 34538, Odeh et al., GCN 34543)\nwith the following telescopes:\n\n0.25-m f/4.8 Newton reflector at Bassano Bresciano Observatory, Italy - MPC Code 565. \n0.32-m f/8.0 (iTelescope) reflector at AstroCamp at Nerpio, Spain - MPC Code I89.\n0.51-m f/6.8 (iTelescope) Dall-Kirkham at Rio Hurtado Valley, Chile - MPC Code X07. \n \n\nWe clearly detected a bright object, in the same location as M.Odeh et al., GCN 34543, within \nthe uncertainty radius of the Swift localization, at:\n\nR.A. (J2000): 17:27:43.32\nDec. (J2000): -16:12:18.8\n\n\nThe results of our photometry are:\n\n------------------------------------------------------ \n Date UT Exp Time R-mag Err IAU STATION\n------------------------------------------------------\n \n2023-08-24.7967 18x20s 13.25 0.057 565\n2023-08-24.8018 18x20s 13.25 0.049 565 \n2023-08-24.8071 12x30s 13.24 0.048 565 \n2023-08-24.8124 12x30s 13.24 0.043 565 \n2023-08-24.8185 12x30s 13.24 0.042 565 \n2023-08-24.9030 10x60s 13.05 - I89\n2023-08-25.1470 10x60s 12.80 - X07\n------------------------------------------------------\n\nMagnitudes were estimated with the pan-STARRS cat. \nand are converted using Lupton (2005) equations.\n\nNot corrected for galactic dust extinction.\n\nFurther observations are planned.\n\nReference:\nhttp://www.osservatoriobassano.org/GRB.asp\n\nThe message may be cited.\n\n\n",
"eventId": "GRB 230824A"
},
{
"subject": "Swift J1727.8-1613 (GRB 230824A): Bassano Bresciano Observatory optical observations",
"submittedHow": "email-legacy",
"bibcode": "2023GCN.34562....1Q",
"createdOn": 1693037110788,
"circularId": 21,
"submitter": "Ulisse Quadri at Bassano Bresciano Obs <oabb@ulisse.bs.it>",
"body": "U.Quadri, P.Madurini and L.Strabla (Bassano Bresciano Astronomical Observatory),\n\nMember of: \nAAVSO - American Association of Variable Star Observers.\nUAI/SSV - Unione Astrofili Italiani/sezione stelle variabili.\nGAC - Gruppo Astrofili Cremonesi.\n\nin a large collaboration with:\nM.G. Dainotti (National Astronomical Observatory of Japan), \nY. Niino (Tokyo University, Institute of Astronomy), \nK. Kalinowski (Aarhus University, Department of Physics and Astronomy),\nB. De Simone (Universita' degli Studi Di Salerno)\nreport: \n\nWe imaged the field of Swift J1727.8-1613(GRB 230824A) \n(Page et al., GCN 34537; Navaneeth et al., GCN 34538, Odeh et al., GCN 34543)\nwith the following telescopes:\n\n0.25-m f/4.8 Newton reflector at Bassano Bresciano Observatory, Italy - MPC Code 565. \n0.32-m f/8.0 (iTelescope) reflector at AstroCamp at Nerpio, Spain - MPC Code I89.\n0.51-m f/6.8 (iTelescope) Dall-Kirkham at Rio Hurtado Valley, Chile - MPC Code X07. \n \n\nWe clearly detected a bright object, in the same location as M.Odeh et al., GCN 34543, within \nthe uncertainty radius of the Swift localization, at:\n\nR.A. (J2000): 17:27:43.32\nDec. (J2000): -16:12:18.8\n\n\nThe results of our photometry are:\n\n------------------------------------------------------ \n Date UT Exp Time R-mag Err IAU STATION\n------------------------------------------------------\n \n2023-08-24.7967 18x20s 13.25 0.057 565\n2023-08-24.8018 18x20s 13.25 0.049 565 \n2023-08-24.8071 12x30s 13.24 0.048 565 \n2023-08-24.8124 12x30s 13.24 0.043 565 \n2023-08-24.8185 12x30s 13.24 0.042 565 \n2023-08-24.9030 10x60s 13.05 - I89\n2023-08-25.1470 10x60s 12.80 - X07\n------------------------------------------------------\n\nMagnitudes were estimated with the pan-STARRS cat. \nand are converted using Lupton (2005) equations.\n\nNot corrected for galactic dust extinction.\n\nFurther observations are planned.\n\nReference:\nhttp://www.osservatoriobassano.org/GRB.asp\n\nThe message may be cited.\n\n\n",
"eventId": "GRB 230824A"
}
],
"circulars_history": [
Expand Down Expand Up @@ -5125,5 +5135,15 @@
"affiliation": "Example",
"submit": 1
}
],
"circulars_change_requests": [
{
"circularId": 21,
"requestorSub": "12345678-abcd-1234-abcd-1234abcd1234",
"body": "This is an example of a request with a missing createdOn field",
"requestor": "Example User at Example <example@example.com>",
"requestorEmail": "example@example.com",
"subject": "Optical Observations for GRB 971227"
}
]
}

0 comments on commit 67bd135

Please sign in to comment.