Skip to content

Commit f2dc6c4

Browse files
committed
Omit inactive sessions
1 parent 69bec11 commit f2dc6c4

File tree

5 files changed

+45
-69
lines changed

5 files changed

+45
-69
lines changed

scripts/sync-sched/schedule-2025.json

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -203,51 +203,6 @@
203203
"end_time": "10:20:00",
204204
"description": ""
205205
},
206-
{
207-
"event_key": "924510",
208-
"active": "N",
209-
"pinned": "N",
210-
"name": "GraphQL at Meta - Jordan Eldredge, Meta",
211-
"event_start": "2025-09-08 09:40",
212-
"event_end": "2025-09-08 09:50",
213-
"event_type": "Keynote Sessions",
214-
"description": "A peek behind the curtain revealing how GraphQL is used at Meta. We will explore how everything from culture, development process, client and server implementations, schema patterns and conventions, advanced tooling and more work together to allow GraphQL to enable great user and developer experiences at Meta.",
215-
"goers": "0",
216-
"seats": "0",
217-
"invite_only": "N",
218-
"venue": "Grote Zaal",
219-
"company": "Intermediate",
220-
"id": "4eec1d8993f89f5599949ae4fbfa4581",
221-
"venue_id": "2152800",
222-
"speakers": [
223-
{
224-
"username": "jordaneldredge1",
225-
"id": "21508644",
226-
"name": "Jordan Eldredge",
227-
"company": "Meta",
228-
"custom_order": 0
229-
}
230-
],
231-
"event_start_year": "2025",
232-
"event_start_month": "September",
233-
"event_start_month_short": "Sep",
234-
"event_start_day": "8",
235-
"event_start_weekday": "Monday",
236-
"event_start_weekday_short": "Mon",
237-
"event_start_time": "09:40",
238-
"event_end_year": "2025",
239-
"event_end_month": "September",
240-
"event_end_month_short": "Sep",
241-
"event_end_day": "8",
242-
"event_end_weekday": "Monday",
243-
"event_end_weekday_short": "Mon",
244-
"event_end_time": "09:50",
245-
"start_date": "2025-09-08",
246-
"start_time": "09:40:00",
247-
"start_time_ts": 1757320800,
248-
"end_date": "2025-09-08",
249-
"end_time": "09:50:00"
250-
},
251206
{
252207
"event_key": "4",
253208
"active": "Y",

scripts/sync-sched/speakers.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@
21852185
"_years": [
21862186
2025
21872187
],
2188-
"~syncedDetailsAt": 1749580595155
2188+
"~syncedDetailsAt": 1749591475884
21892189
},
21902190
{
21912191
"username": "michael.bleigh",
@@ -2224,7 +2224,7 @@
22242224
"_years": [
22252225
2025
22262226
],
2227-
"~syncedDetailsAt": 1749580595155
2227+
"~syncedDetailsAt": 1749591475884
22282228
},
22292229
{
22302230
"username": "omribruchim",
@@ -2436,7 +2436,7 @@
24362436
"_years": [
24372437
2025
24382438
],
2439-
"~syncedDetailsAt": 1749580595155
2439+
"~syncedDetailsAt": 1749591475884
24402440
},
24412441
{
24422442
"username": "rickbijkerk54",
@@ -2451,7 +2451,7 @@
24512451
"_years": [
24522452
2025
24532453
],
2454-
"~syncedDetailsAt": 1749580595155
2454+
"~syncedDetailsAt": 1749591392603
24552455
},
24562456
{
24572457
"username": "robert.balicki",
@@ -2569,7 +2569,7 @@
25692569
"_years": [
25702570
2025
25712571
],
2572-
"~syncedDetailsAt": 1749580595155
2572+
"~syncedDetailsAt": 1749591392603
25732573
},
25742574
{
25752575
"username": "sanvertarmur",

scripts/sync-sched/sync.ts

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,19 @@ async function updateSpeakerDetails(
181181
})
182182

183183
const toUpdate = byUpdateTime.slice(0, quota)
184+
console.log(`Fetching additional details for ${toUpdate.length} speakers...`)
185+
console.log(
186+
toUpdate
187+
.map(s =>
188+
[
189+
`- ${s.username.padEnd(32, " ")}`,
190+
s["~syncedDetailsAt"]
191+
? `last synced at ${new Date(s["~syncedDetailsAt"]).toLocaleString()}`
192+
: "without details yet",
193+
].join("\t"),
194+
)
195+
.join("\n"),
196+
)
184197

185198
const limit = pLimit(5)
186199
const updated = await Promise.all(
@@ -193,15 +206,20 @@ async function updateSpeakerDetails(
193206
const location = locations.get(speaker.username)
194207
if (location) {
195208
const [key, index] = location
209+
const current =
210+
key === "changed" ? comparison[key][index].new : comparison[key][index]
211+
212+
const newValue = mergeSpeaker(current, speaker)
213+
const diff = objectDiff({ old: current, new: newValue })
214+
if (diff.trim()) {
215+
console.log(diff)
216+
}
217+
newValue["~syncedDetailsAt"] = Date.now()
218+
196219
if (key === "changed") {
197-
comparison[key][index].new = mergeSpeaker(
198-
comparison[key][index].new,
199-
speaker,
200-
)
201-
comparison[key][index].new["~syncedDetailsAt"] = Date.now()
220+
comparison[key][index].new = newValue
202221
} else {
203-
comparison[key][index] = mergeSpeaker(comparison[key][index], speaker)
204-
comparison[key][index]["~syncedDetailsAt"] = Date.now()
222+
comparison[key][index] = newValue
205223
}
206224
}
207225
}

src/app/conf/_api/sched-client.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,20 @@ export async function getSchedule(
110110
"/session/export",
111111
)) as ScheduleSession[]
112112

113-
const result = sessions.map(session => {
114-
const { description } = session
115-
116-
// This field is sometimes sent as a string, sometimes as a number,
117-
// so it creates noise in our diffs, but we don't use it anyway.
118-
delete (session as Record<string, unknown>)["event_type_sort"]
119-
120-
return {
121-
...session,
122-
description: preprocessDescription(description),
123-
}
124-
})
113+
const result = sessions
114+
.filter(session => session.active === "Y")
115+
.map(session => {
116+
const { description } = session
117+
118+
// This field is sometimes sent as a string, sometimes as a number,
119+
// so it creates noise in our diffs, but we don't use it anyway.
120+
delete (session as Record<string, unknown>)["event_type_sort"]
121+
122+
return {
123+
...session,
124+
description: preprocessDescription(description),
125+
}
126+
})
125127

126128
return result
127129
}

src/app/conf/_api/sched-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export type ScheduleSession = {
22
id: string
3+
active: "Y" | "N"
34
audience: string
45
description: string
56
event_end: string

0 commit comments

Comments
 (0)