forge
Explore
Log in

Don't you dare go Hollow

Enrollment replay re-check + drop dead constants and pins

Browse files at this commit

799b3b59863ce10888fd6a4f4aaf8ccccfe6a8c8Ahmet Kaan GümüşParent: 932f861
  • fix
    • enrollment replay re-check + drop dead constants and pins
Show full message
🐛 fix: enrollment replay re-check + drop dead constants and pins
.sqlx/query-162bc2deeef2ea6e238026df897a64a0021969fe8b805761cdd742e74f07e657.json → .sqlx/query-04bae764ec61cfeb13e3bfe67da8853fb83eca5f2a2d112fac7970cb6f653bd0.jsonrenamed+4 -16
@@ -1,21 +1,10 @@
1 {1 {
2 "db_name": "PostgreSQL",2 "db_name": "PostgreSQL",
3- "query": "INSERT INTO user_session (id, app_user, token, expires_at)\n VALUES ($1, $2, $3, $4)\n RETURNING id AS \"id: SessionId\",\n app_user AS \"user: UserId\",\n token AS \"token: SessionToken\",\n expires_at AS \"expires_at: Timestamp\"",3+ "query": "INSERT INTO user_session (id, app_user, token, expires_at)\n VALUES ($1, $2, $3, $4)\n RETURNING\n app_user AS \"user: UserId\",\n token AS \"token: SessionToken\",\n expires_at AS \"expires_at: Timestamp\"",
4 "describe": {4 "describe": {
5 "columns": [5 "columns": [
6 {6 {
7 "ordinal": 0,7 "ordinal": 0,
8- "name": "id: SessionId",
9- "type_info": "Uuid",
10- "origin": {
11- "Table": {
12- "table": "user_session",
13- "name": "id"
14- }
15- }
16- },
17- {
18- "ordinal": 1,
19 "name": "user: UserId",8 "name": "user: UserId",
20 "type_info": "Uuid",9 "type_info": "Uuid",
21 "origin": {10 "origin": {
@@ -26,7 +15,7 @@
26 }15 }
27 },16 },
28 {17 {
29- "ordinal": 2,18+ "ordinal": 1,
30 "name": "token: SessionToken",19 "name": "token: SessionToken",
31 "type_info": "Text",20 "type_info": "Text",
32 "origin": {21 "origin": {
@@ -37,7 +26,7 @@
37 }26 }
38 },27 },
39 {28 {
40- "ordinal": 3,29+ "ordinal": 2,
41 "name": "expires_at: Timestamp",30 "name": "expires_at: Timestamp",
42 "type_info": "Int8",31 "type_info": "Int8",
43 "origin": {32 "origin": {
@@ -57,11 +46,10 @@
57 ]46 ]
58 },47 },
59 "nullable": [48 "nullable": [
60- false,
61 false,49 false,
62 false,50 false,
63 false51 false
64 ]52 ]
65 },53 },
66- "hash": "162bc2deeef2ea6e238026df897a64a0021969fe8b805761cdd742e74f07e657"54+ "hash": "04bae764ec61cfeb13e3bfe67da8853fb83eca5f2a2d112fac7970cb6f653bd0"
67 }55 }
.sqlx/query-3a1a31d80635fd424a8d6e7e3c0242317c7a8c34d8900f70714c1db991b93809.json → .sqlx/query-157817bc37b717852d43d1a631650e579a4da1269fab21e44197c0106084c695.jsonrenamed+4 -16
@@ -1,21 +1,10 @@
1 {1 {
2 "db_name": "PostgreSQL",2 "db_name": "PostgreSQL",
3- "query": "SELECT id AS \"id: SessionId\",\n app_user AS \"user: UserId\",\n token AS \"token: SessionToken\",\n expires_at AS \"expires_at: Timestamp\"\n FROM user_session WHERE token = $1",3+ "query": "SELECT\n app_user AS \"user: UserId\",\n token AS \"token: SessionToken\",\n expires_at AS \"expires_at: Timestamp\"\n FROM user_session WHERE token = $1",
4 "describe": {4 "describe": {
5 "columns": [5 "columns": [
6 {6 {
7 "ordinal": 0,7 "ordinal": 0,
8- "name": "id: SessionId",
9- "type_info": "Uuid",
10- "origin": {
11- "Table": {
12- "table": "user_session",
13- "name": "id"
14- }
15- }
16- },
17- {
18- "ordinal": 1,
19 "name": "user: UserId",8 "name": "user: UserId",
20 "type_info": "Uuid",9 "type_info": "Uuid",
21 "origin": {10 "origin": {
@@ -26,7 +15,7 @@
26 }15 }
27 },16 },
28 {17 {
29- "ordinal": 2,18+ "ordinal": 1,
30 "name": "token: SessionToken",19 "name": "token: SessionToken",
31 "type_info": "Text",20 "type_info": "Text",
32 "origin": {21 "origin": {
@@ -37,7 +26,7 @@
37 }26 }
38 },27 },
39 {28 {
40- "ordinal": 3,29+ "ordinal": 2,
41 "name": "expires_at: Timestamp",30 "name": "expires_at: Timestamp",
42 "type_info": "Int8",31 "type_info": "Int8",
43 "origin": {32 "origin": {
@@ -54,11 +43,10 @@
54 ]43 ]
55 },44 },
56 "nullable": [45 "nullable": [
57- false,
58 false,46 false,
59 false,47 false,
60 false48 false
61 ]49 ]
62 },50 },
63- "hash": "3a1a31d80635fd424a8d6e7e3c0242317c7a8c34d8900f70714c1db991b93809"51+ "hash": "157817bc37b717852d43d1a631650e579a4da1269fab21e44197c0106084c695"
64 }52 }
.sqlx/query-3eecd3bb3aa0928b961b760d44274420bbd002c523664ef36b66bc55f9804fb7.json → .sqlx/query-290550b5ce584441f5343802004891866199a2dd3d3c822cccc471061d842c71.jsonrenamed+11 -23
@@ -1,21 +1,10 @@
1 {1 {
2 "db_name": "PostgreSQL",2 "db_name": "PostgreSQL",
3- "query": "INSERT INTO settings (id, exam_kinds, attendance_statuses, grade_bands,\n max_file_bytes, chatbot_history_turns,\n max_chatbot_message_len, max_chatbot_threads,\n meal_slots, dietary_tags, meal_cancel_cutoff_minutes)\n VALUES ('school', $1, $2, $3, $4, $5, $6, $7, $8, $9, $10)\n ON CONFLICT (id) DO UPDATE SET\n exam_kinds = $1,\n attendance_statuses = $2,\n grade_bands = $3,\n max_file_bytes = $4,\n chatbot_history_turns = $5,\n max_chatbot_message_len = $6,\n max_chatbot_threads = $7,\n meal_slots = $8,\n dietary_tags = $9,\n meal_cancel_cutoff_minutes = $10\n WHERE settings.exam_kinds IS NOT DISTINCT FROM $11\n AND settings.attendance_statuses IS NOT DISTINCT FROM $12\n AND settings.grade_bands IS NOT DISTINCT FROM $13\n AND settings.max_file_bytes IS NOT DISTINCT FROM $14\n AND settings.chatbot_history_turns IS NOT DISTINCT FROM $15\n AND settings.max_chatbot_message_len IS NOT DISTINCT FROM $16\n AND settings.max_chatbot_threads IS NOT DISTINCT FROM $17\n AND settings.meal_slots IS NOT DISTINCT FROM $18\n AND settings.dietary_tags IS NOT DISTINCT FROM $19\n AND settings.meal_cancel_cutoff_minutes IS NOT DISTINCT FROM $20\n RETURNING id,\n exam_kinds AS \"exam_kinds: Json<Vec<ExamKindDef>>\",\n attendance_statuses,\n grade_bands AS \"grade_bands: Json<Vec<GradeBand>>\",\n max_file_bytes,\n chatbot_history_turns,\n max_chatbot_message_len,\n max_chatbot_threads,\n meal_slots AS \"meal_slots: Json<Vec<MealSlotDef>>\",\n dietary_tags,\n meal_cancel_cutoff_minutes",3+ "query": "INSERT INTO settings (id, exam_kinds, attendance_statuses, grade_bands,\n max_file_bytes, chatbot_history_turns,\n max_chatbot_message_len, max_chatbot_threads,\n meal_slots, dietary_tags, meal_cancel_cutoff_minutes)\n VALUES ('school', $1, $2, $3, $4, $5, $6, $7, $8, $9, $10)\n ON CONFLICT (id) DO UPDATE SET\n exam_kinds = $1,\n attendance_statuses = $2,\n grade_bands = $3,\n max_file_bytes = $4,\n chatbot_history_turns = $5,\n max_chatbot_message_len = $6,\n max_chatbot_threads = $7,\n meal_slots = $8,\n dietary_tags = $9,\n meal_cancel_cutoff_minutes = $10\n WHERE settings.exam_kinds IS NOT DISTINCT FROM $11\n AND settings.attendance_statuses IS NOT DISTINCT FROM $12\n AND settings.grade_bands IS NOT DISTINCT FROM $13\n AND settings.max_file_bytes IS NOT DISTINCT FROM $14\n AND settings.chatbot_history_turns IS NOT DISTINCT FROM $15\n AND settings.max_chatbot_message_len IS NOT DISTINCT FROM $16\n AND settings.max_chatbot_threads IS NOT DISTINCT FROM $17\n AND settings.meal_slots IS NOT DISTINCT FROM $18\n AND settings.dietary_tags IS NOT DISTINCT FROM $19\n AND settings.meal_cancel_cutoff_minutes IS NOT DISTINCT FROM $20\n RETURNING\n exam_kinds AS \"exam_kinds: Json<Vec<ExamKindDef>>\",\n attendance_statuses,\n grade_bands AS \"grade_bands: Json<Vec<GradeBand>>\",\n max_file_bytes,\n chatbot_history_turns,\n max_chatbot_message_len,\n max_chatbot_threads,\n meal_slots AS \"meal_slots: Json<Vec<MealSlotDef>>\",\n dietary_tags,\n meal_cancel_cutoff_minutes",
4 "describe": {4 "describe": {
5 "columns": [5 "columns": [
6 {6 {
7 "ordinal": 0,7 "ordinal": 0,
8- "name": "id",
9- "type_info": "Text",
10- "origin": {
11- "Table": {
12- "table": "settings",
13- "name": "id"
14- }
15- }
16- },
17- {
18- "ordinal": 1,
19 "name": "exam_kinds: Json<Vec<ExamKindDef>>",8 "name": "exam_kinds: Json<Vec<ExamKindDef>>",
20 "type_info": "Jsonb",9 "type_info": "Jsonb",
21 "origin": {10 "origin": {
@@ -26,7 +15,7 @@
26 }15 }
27 },16 },
28 {17 {
29- "ordinal": 2,18+ "ordinal": 1,
30 "name": "attendance_statuses",19 "name": "attendance_statuses",
31 "type_info": "TextArray",20 "type_info": "TextArray",
32 "origin": {21 "origin": {
@@ -37,7 +26,7 @@
37 }26 }
38 },27 },
39 {28 {
40- "ordinal": 3,29+ "ordinal": 2,
41 "name": "grade_bands: Json<Vec<GradeBand>>",30 "name": "grade_bands: Json<Vec<GradeBand>>",
42 "type_info": "Jsonb",31 "type_info": "Jsonb",
43 "origin": {32 "origin": {
@@ -48,7 +37,7 @@
48 }37 }
49 },38 },
50 {39 {
51- "ordinal": 4,40+ "ordinal": 3,
52 "name": "max_file_bytes",41 "name": "max_file_bytes",
53 "type_info": "Int8",42 "type_info": "Int8",
54 "origin": {43 "origin": {
@@ -59,7 +48,7 @@
59 }48 }
60 },49 },
61 {50 {
62- "ordinal": 5,51+ "ordinal": 4,
63 "name": "chatbot_history_turns",52 "name": "chatbot_history_turns",
64 "type_info": "Int8",53 "type_info": "Int8",
65 "origin": {54 "origin": {
@@ -70,7 +59,7 @@
70 }59 }
71 },60 },
72 {61 {
73- "ordinal": 6,62+ "ordinal": 5,
74 "name": "max_chatbot_message_len",63 "name": "max_chatbot_message_len",
75 "type_info": "Int8",64 "type_info": "Int8",
76 "origin": {65 "origin": {
@@ -81,7 +70,7 @@
81 }70 }
82 },71 },
83 {72 {
84- "ordinal": 7,73+ "ordinal": 6,
85 "name": "max_chatbot_threads",74 "name": "max_chatbot_threads",
86 "type_info": "Int8",75 "type_info": "Int8",
87 "origin": {76 "origin": {
@@ -92,7 +81,7 @@
92 }81 }
93 },82 },
94 {83 {
95- "ordinal": 8,84+ "ordinal": 7,
96 "name": "meal_slots: Json<Vec<MealSlotDef>>",85 "name": "meal_slots: Json<Vec<MealSlotDef>>",
97 "type_info": "Jsonb",86 "type_info": "Jsonb",
98 "origin": {87 "origin": {
@@ -103,7 +92,7 @@
103 }92 }
104 },93 },
105 {94 {
106- "ordinal": 9,95+ "ordinal": 8,
107 "name": "dietary_tags",96 "name": "dietary_tags",
108 "type_info": "TextArray",97 "type_info": "TextArray",
109 "origin": {98 "origin": {
@@ -114,7 +103,7 @@
114 }103 }
115 },104 },
116 {105 {
117- "ordinal": 10,106+ "ordinal": 9,
118 "name": "meal_cancel_cutoff_minutes",107 "name": "meal_cancel_cutoff_minutes",
119 "type_info": "Int8",108 "type_info": "Int8",
120 "origin": {109 "origin": {
@@ -153,7 +142,6 @@
153 false,142 false,
154 false,143 false,
155 false,144 false,
156- false,
157 true,145 true,
158 true,146 true,
159 true,147 true,
@@ -163,5 +151,5 @@
163 true151 true
164 ]152 ]
165 },153 },
166- "hash": "3eecd3bb3aa0928b961b760d44274420bbd002c523664ef36b66bc55f9804fb7"154+ "hash": "290550b5ce584441f5343802004891866199a2dd3d3c822cccc471061d842c71"
167 }155 }
.sqlx/query-c2d6ed2beddec9abd6cdf73e700ae033299aacceac861f17d602e0e2efd6868f.json → .sqlx/query-50bc70c10d341952865a7962061842b60e9b67c8357456a83d8b1a37eaf0e570.jsonrenamed+4 -28
@@ -1,21 +1,10 @@
1 {1 {
2 "db_name": "PostgreSQL",2 "db_name": "PostgreSQL",
3- "query": "INSERT INTO builder_session (id, builder, token, created_at, expires_at)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING id,\n builder AS \"builder: BuilderId\",\n token AS \"token: SessionToken\",\n created_at AS \"created_at: Timestamp\",\n expires_at AS \"expires_at: Timestamp\"",3+ "query": "INSERT INTO builder_session (id, builder, token, created_at, expires_at)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING\n builder AS \"builder: BuilderId\",\n token AS \"token: SessionToken\",\n expires_at AS \"expires_at: Timestamp\"",
4 "describe": {4 "describe": {
5 "columns": [5 "columns": [
6 {6 {
7 "ordinal": 0,7 "ordinal": 0,
8- "name": "id",
9- "type_info": "Uuid",
10- "origin": {
11- "Table": {
12- "table": "builder_session",
13- "name": "id"
14- }
15- }
16- },
17- {
18- "ordinal": 1,
19 "name": "builder: BuilderId",8 "name": "builder: BuilderId",
20 "type_info": "Uuid",9 "type_info": "Uuid",
21 "origin": {10 "origin": {
@@ -26,7 +15,7 @@
26 }15 }
27 },16 },
28 {17 {
29- "ordinal": 2,18+ "ordinal": 1,
30 "name": "token: SessionToken",19 "name": "token: SessionToken",
31 "type_info": "Text",20 "type_info": "Text",
32 "origin": {21 "origin": {
@@ -37,18 +26,7 @@
37 }26 }
38 },27 },
39 {28 {
40- "ordinal": 3,29+ "ordinal": 2,
41- "name": "created_at: Timestamp",
42- "type_info": "Int8",
43- "origin": {
44- "Table": {
45- "table": "builder_session",
46- "name": "created_at"
47- }
48- }
49- },
50- {
51- "ordinal": 4,
52 "name": "expires_at: Timestamp",30 "name": "expires_at: Timestamp",
53 "type_info": "Int8",31 "type_info": "Int8",
54 "origin": {32 "origin": {
@@ -69,12 +47,10 @@
69 ]47 ]
70 },48 },
71 "nullable": [49 "nullable": [
72- false,
73- false,
74 false,50 false,
75 false,51 false,
76 false52 false
77 ]53 ]
78 },54 },
79- "hash": "c2d6ed2beddec9abd6cdf73e700ae033299aacceac861f17d602e0e2efd6868f"55+ "hash": "50bc70c10d341952865a7962061842b60e9b67c8357456a83d8b1a37eaf0e570"
80 }56 }
.sqlx/query-6bf5756d2c738d68617d5cb6fbc8f15b5e574977db29e41469b7c4e439ea92fc.json → .sqlx/query-8a2042be8e7358d9c9f9f8a906ff113f71fa4ac519aec8519ee6b40bc51f694d.jsonrenamed+11 -23
@@ -1,21 +1,10 @@
1 {1 {
2 "db_name": "PostgreSQL",2 "db_name": "PostgreSQL",
3- "query": "SELECT id,\n exam_kinds AS \"exam_kinds: Json<Vec<ExamKindDef>>\",\n attendance_statuses,\n grade_bands AS \"grade_bands: Json<Vec<GradeBand>>\",\n max_file_bytes,\n chatbot_history_turns,\n max_chatbot_message_len,\n max_chatbot_threads,\n meal_slots AS \"meal_slots: Json<Vec<MealSlotDef>>\",\n dietary_tags,\n meal_cancel_cutoff_minutes\n FROM settings WHERE id = 'school'",3+ "query": "SELECT\n exam_kinds AS \"exam_kinds: Json<Vec<ExamKindDef>>\",\n attendance_statuses,\n grade_bands AS \"grade_bands: Json<Vec<GradeBand>>\",\n max_file_bytes,\n chatbot_history_turns,\n max_chatbot_message_len,\n max_chatbot_threads,\n meal_slots AS \"meal_slots: Json<Vec<MealSlotDef>>\",\n dietary_tags,\n meal_cancel_cutoff_minutes\n FROM settings WHERE id = 'school'",
4 "describe": {4 "describe": {
5 "columns": [5 "columns": [
6 {6 {
7 "ordinal": 0,7 "ordinal": 0,
8- "name": "id",
9- "type_info": "Text",
10- "origin": {
11- "Table": {
12- "table": "settings",
13- "name": "id"
14- }
15- }
16- },
17- {
18- "ordinal": 1,
19 "name": "exam_kinds: Json<Vec<ExamKindDef>>",8 "name": "exam_kinds: Json<Vec<ExamKindDef>>",
20 "type_info": "Jsonb",9 "type_info": "Jsonb",
21 "origin": {10 "origin": {
@@ -26,7 +15,7 @@
26 }15 }
27 },16 },
28 {17 {
29- "ordinal": 2,18+ "ordinal": 1,
30 "name": "attendance_statuses",19 "name": "attendance_statuses",
31 "type_info": "TextArray",20 "type_info": "TextArray",
32 "origin": {21 "origin": {
@@ -37,7 +26,7 @@
37 }26 }
38 },27 },
39 {28 {
40- "ordinal": 3,29+ "ordinal": 2,
41 "name": "grade_bands: Json<Vec<GradeBand>>",30 "name": "grade_bands: Json<Vec<GradeBand>>",
42 "type_info": "Jsonb",31 "type_info": "Jsonb",
43 "origin": {32 "origin": {
@@ -48,7 +37,7 @@
48 }37 }
49 },38 },
50 {39 {
51- "ordinal": 4,40+ "ordinal": 3,
52 "name": "max_file_bytes",41 "name": "max_file_bytes",
53 "type_info": "Int8",42 "type_info": "Int8",
54 "origin": {43 "origin": {
@@ -59,7 +48,7 @@
59 }48 }
60 },49 },
61 {50 {
62- "ordinal": 5,51+ "ordinal": 4,
63 "name": "chatbot_history_turns",52 "name": "chatbot_history_turns",
64 "type_info": "Int8",53 "type_info": "Int8",
65 "origin": {54 "origin": {
@@ -70,7 +59,7 @@
70 }59 }
71 },60 },
72 {61 {
73- "ordinal": 6,62+ "ordinal": 5,
74 "name": "max_chatbot_message_len",63 "name": "max_chatbot_message_len",
75 "type_info": "Int8",64 "type_info": "Int8",
76 "origin": {65 "origin": {
@@ -81,7 +70,7 @@
81 }70 }
82 },71 },
83 {72 {
84- "ordinal": 7,73+ "ordinal": 6,
85 "name": "max_chatbot_threads",74 "name": "max_chatbot_threads",
86 "type_info": "Int8",75 "type_info": "Int8",
87 "origin": {76 "origin": {
@@ -92,7 +81,7 @@
92 }81 }
93 },82 },
94 {83 {
95- "ordinal": 8,84+ "ordinal": 7,
96 "name": "meal_slots: Json<Vec<MealSlotDef>>",85 "name": "meal_slots: Json<Vec<MealSlotDef>>",
97 "type_info": "Jsonb",86 "type_info": "Jsonb",
98 "origin": {87 "origin": {
@@ -103,7 +92,7 @@
103 }92 }
104 },93 },
105 {94 {
106- "ordinal": 9,95+ "ordinal": 8,
107 "name": "dietary_tags",96 "name": "dietary_tags",
108 "type_info": "TextArray",97 "type_info": "TextArray",
109 "origin": {98 "origin": {
@@ -114,7 +103,7 @@
114 }103 }
115 },104 },
116 {105 {
117- "ordinal": 10,106+ "ordinal": 9,
118 "name": "meal_cancel_cutoff_minutes",107 "name": "meal_cancel_cutoff_minutes",
119 "type_info": "Int8",108 "type_info": "Int8",
120 "origin": {109 "origin": {
@@ -132,7 +121,6 @@
132 false,121 false,
133 false,122 false,
134 false,123 false,
135- false,
136 true,124 true,
137 true,125 true,
138 true,126 true,
@@ -142,5 +130,5 @@
142 true130 true
143 ]131 ]
144 },132 },
145- "hash": "6bf5756d2c738d68617d5cb6fbc8f15b5e574977db29e41469b7c4e439ea92fc"133+ "hash": "8a2042be8e7358d9c9f9f8a906ff113f71fa4ac519aec8519ee6b40bc51f694d"
146 }134 }
.sqlx/query-bfb85e3187ab47859192ef5fbebd29e2ad820cc231d7ef91811ec932adb4665a.json → .sqlx/query-af3174cc0f3bf3447eb23625d746861e229b6bf882a2739182eccaf2c4598487.jsonrenamed+4 -28
@@ -1,21 +1,10 @@
1 {1 {
2 "db_name": "PostgreSQL",2 "db_name": "PostgreSQL",
3- "query": "SELECT id,\n builder AS \"builder: BuilderId\",\n token AS \"token: SessionToken\",\n created_at AS \"created_at: Timestamp\",\n expires_at AS \"expires_at: Timestamp\"\n FROM builder_session WHERE token = $1",3+ "query": "SELECT\n builder AS \"builder: BuilderId\",\n token AS \"token: SessionToken\",\n expires_at AS \"expires_at: Timestamp\"\n FROM builder_session WHERE token = $1",
4 "describe": {4 "describe": {
5 "columns": [5 "columns": [
6 {6 {
7 "ordinal": 0,7 "ordinal": 0,
8- "name": "id",
9- "type_info": "Uuid",
10- "origin": {
11- "Table": {
12- "table": "builder_session",
13- "name": "id"
14- }
15- }
16- },
17- {
18- "ordinal": 1,
19 "name": "builder: BuilderId",8 "name": "builder: BuilderId",
20 "type_info": "Uuid",9 "type_info": "Uuid",
21 "origin": {10 "origin": {
@@ -26,7 +15,7 @@
26 }15 }
27 },16 },
28 {17 {
29- "ordinal": 2,18+ "ordinal": 1,
30 "name": "token: SessionToken",19 "name": "token: SessionToken",
31 "type_info": "Text",20 "type_info": "Text",
32 "origin": {21 "origin": {
@@ -37,18 +26,7 @@
37 }26 }
38 },27 },
39 {28 {
40- "ordinal": 3,29+ "ordinal": 2,
41- "name": "created_at: Timestamp",
42- "type_info": "Int8",
43- "origin": {
44- "Table": {
45- "table": "builder_session",
46- "name": "created_at"
47- }
48- }
49- },
50- {
51- "ordinal": 4,
52 "name": "expires_at: Timestamp",30 "name": "expires_at: Timestamp",
53 "type_info": "Int8",31 "type_info": "Int8",
54 "origin": {32 "origin": {
@@ -65,12 +43,10 @@
65 ]43 ]
66 },44 },
67 "nullable": [45 "nullable": [
68- false,
69- false,
70 false,46 false,
71 false,47 false,
72 false48 false
73 ]49 ]
74 },50 },
75- "hash": "bfb85e3187ab47859192ef5fbebd29e2ad820cc231d7ef91811ec932adb4665a"51+ "hash": "af3174cc0f3bf3447eb23625d746861e229b6bf882a2739182eccaf2c4598487"
76 }52 }
.sqlx/query-2cf8cd6b4d75c5ca5d5f3a7c7ac6c6042438242e59b6c5b5c220117579cc575d.json → .sqlx/query-da48c3255d2e13ec4031617c4e549cd7f9e911516b7615c36e1dfe07959ff51c.jsonrenamed+11 -23
@@ -1,21 +1,10 @@
1 {1 {
2 "db_name": "PostgreSQL",2 "db_name": "PostgreSQL",
3- "query": "INSERT INTO settings (id, exam_kinds, attendance_statuses, grade_bands,\n max_file_bytes, chatbot_history_turns,\n max_chatbot_message_len, max_chatbot_threads,\n meal_slots, dietary_tags, meal_cancel_cutoff_minutes)\n VALUES ('school', $1, $2, $3, $4, $5, $6, $7, $8, $9, $10)\n ON CONFLICT (id) DO UPDATE SET\n exam_kinds = EXCLUDED.exam_kinds,\n attendance_statuses = EXCLUDED.attendance_statuses,\n grade_bands = EXCLUDED.grade_bands,\n max_file_bytes = EXCLUDED.max_file_bytes,\n chatbot_history_turns = EXCLUDED.chatbot_history_turns,\n max_chatbot_message_len = EXCLUDED.max_chatbot_message_len,\n max_chatbot_threads = EXCLUDED.max_chatbot_threads,\n meal_slots = EXCLUDED.meal_slots,\n dietary_tags = EXCLUDED.dietary_tags,\n meal_cancel_cutoff_minutes = EXCLUDED.meal_cancel_cutoff_minutes\n RETURNING id,\n exam_kinds AS \"exam_kinds: Json<Vec<ExamKindDef>>\",\n attendance_statuses,\n grade_bands AS \"grade_bands: Json<Vec<GradeBand>>\",\n max_file_bytes,\n chatbot_history_turns,\n max_chatbot_message_len,\n max_chatbot_threads,\n meal_slots AS \"meal_slots: Json<Vec<MealSlotDef>>\",\n dietary_tags,\n meal_cancel_cutoff_minutes",3+ "query": "INSERT INTO settings (id, exam_kinds, attendance_statuses, grade_bands,\n max_file_bytes, chatbot_history_turns,\n max_chatbot_message_len, max_chatbot_threads,\n meal_slots, dietary_tags, meal_cancel_cutoff_minutes)\n VALUES ('school', $1, $2, $3, $4, $5, $6, $7, $8, $9, $10)\n ON CONFLICT (id) DO UPDATE SET\n exam_kinds = EXCLUDED.exam_kinds,\n attendance_statuses = EXCLUDED.attendance_statuses,\n grade_bands = EXCLUDED.grade_bands,\n max_file_bytes = EXCLUDED.max_file_bytes,\n chatbot_history_turns = EXCLUDED.chatbot_history_turns,\n max_chatbot_message_len = EXCLUDED.max_chatbot_message_len,\n max_chatbot_threads = EXCLUDED.max_chatbot_threads,\n meal_slots = EXCLUDED.meal_slots,\n dietary_tags = EXCLUDED.dietary_tags,\n meal_cancel_cutoff_minutes = EXCLUDED.meal_cancel_cutoff_minutes\n RETURNING\n exam_kinds AS \"exam_kinds: Json<Vec<ExamKindDef>>\",\n attendance_statuses,\n grade_bands AS \"grade_bands: Json<Vec<GradeBand>>\",\n max_file_bytes,\n chatbot_history_turns,\n max_chatbot_message_len,\n max_chatbot_threads,\n meal_slots AS \"meal_slots: Json<Vec<MealSlotDef>>\",\n dietary_tags,\n meal_cancel_cutoff_minutes",
4 "describe": {4 "describe": {
5 "columns": [5 "columns": [
6 {6 {
7 "ordinal": 0,7 "ordinal": 0,
8- "name": "id",
9- "type_info": "Text",
10- "origin": {
11- "Table": {
12- "table": "settings",
13- "name": "id"
14- }
15- }
16- },
17- {
18- "ordinal": 1,
19 "name": "exam_kinds: Json<Vec<ExamKindDef>>",8 "name": "exam_kinds: Json<Vec<ExamKindDef>>",
20 "type_info": "Jsonb",9 "type_info": "Jsonb",
21 "origin": {10 "origin": {
@@ -26,7 +15,7 @@
26 }15 }
27 },16 },
28 {17 {
29- "ordinal": 2,18+ "ordinal": 1,
30 "name": "attendance_statuses",19 "name": "attendance_statuses",
31 "type_info": "TextArray",20 "type_info": "TextArray",
32 "origin": {21 "origin": {
@@ -37,7 +26,7 @@
37 }26 }
38 },27 },
39 {28 {
40- "ordinal": 3,29+ "ordinal": 2,
41 "name": "grade_bands: Json<Vec<GradeBand>>",30 "name": "grade_bands: Json<Vec<GradeBand>>",
42 "type_info": "Jsonb",31 "type_info": "Jsonb",
43 "origin": {32 "origin": {
@@ -48,7 +37,7 @@
48 }37 }
49 },38 },
50 {39 {
51- "ordinal": 4,40+ "ordinal": 3,
52 "name": "max_file_bytes",41 "name": "max_file_bytes",
53 "type_info": "Int8",42 "type_info": "Int8",
54 "origin": {43 "origin": {
@@ -59,7 +48,7 @@
59 }48 }
60 },49 },
61 {50 {
62- "ordinal": 5,51+ "ordinal": 4,
63 "name": "chatbot_history_turns",52 "name": "chatbot_history_turns",
64 "type_info": "Int8",53 "type_info": "Int8",
65 "origin": {54 "origin": {
@@ -70,7 +59,7 @@
70 }59 }
71 },60 },
72 {61 {
73- "ordinal": 6,62+ "ordinal": 5,
74 "name": "max_chatbot_message_len",63 "name": "max_chatbot_message_len",
75 "type_info": "Int8",64 "type_info": "Int8",
76 "origin": {65 "origin": {
@@ -81,7 +70,7 @@
81 }70 }
82 },71 },
83 {72 {
84- "ordinal": 7,73+ "ordinal": 6,
85 "name": "max_chatbot_threads",74 "name": "max_chatbot_threads",
86 "type_info": "Int8",75 "type_info": "Int8",
87 "origin": {76 "origin": {
@@ -92,7 +81,7 @@
92 }81 }
93 },82 },
94 {83 {
95- "ordinal": 8,84+ "ordinal": 7,
96 "name": "meal_slots: Json<Vec<MealSlotDef>>",85 "name": "meal_slots: Json<Vec<MealSlotDef>>",
97 "type_info": "Jsonb",86 "type_info": "Jsonb",
98 "origin": {87 "origin": {
@@ -103,7 +92,7 @@
103 }92 }
104 },93 },
105 {94 {
106- "ordinal": 9,95+ "ordinal": 8,
107 "name": "dietary_tags",96 "name": "dietary_tags",
108 "type_info": "TextArray",97 "type_info": "TextArray",
109 "origin": {98 "origin": {
@@ -114,7 +103,7 @@
114 }103 }
115 },104 },
116 {105 {
117- "ordinal": 10,106+ "ordinal": 9,
118 "name": "meal_cancel_cutoff_minutes",107 "name": "meal_cancel_cutoff_minutes",
119 "type_info": "Int8",108 "type_info": "Int8",
120 "origin": {109 "origin": {
@@ -143,7 +132,6 @@
143 false,132 false,
144 false,133 false,
145 false,134 false,
146- false,
147 true,135 true,
148 true,136 true,
149 true,137 true,
@@ -153,5 +141,5 @@
153 true141 true
154 ]142 ]
155 },143 },
156- "hash": "2cf8cd6b4d75c5ca5d5f3a7c7ac6c6042438242e59b6c5b5c220117579cc575d"144+ "hash": "da48c3255d2e13ec4031617c4e549cd7f9e911516b7615c36e1dfe07959ff51c"
157 }145 }
src/constant.rsmodified+0 -11
@@ -829,19 +829,8 @@ pub const MAX_ETAG_BODY_BYTES: u64 = 1 << 20; // 1 MiB
829 pub const REPLY_CHUNKS: usize = 8;829 pub const REPLY_CHUNKS: usize = 8;
830 pub const MIN_CHUNK_CHARS: usize = 24;830 pub const MIN_CHUNK_CHARS: usize = 24;
831 831
832-// --- query text --------------------------------------------------------
833-
834-/// The whole of [`crate::db::bank_question::usage_counts`]:
835-/// **one** statement (no `;`), so a page of templates costs one round trip no
836-/// matter how long it is. Named so a test can assert that, since a per-row
837-/// `count()` is exactly the N+1 this page was cleaned of once.
838-pub const USAGE_COUNTS_SQL: &str =
839- "SELECT from_bank, count() AS n FROM exam_question WHERE from_bank IN $ids GROUP BY from_bank";
840-
841 // --- database tables ---------------------------------------------------832 // --- database tables ---------------------------------------------------
842 833
843-pub const USER_TABLE: &str = "user";
844-pub const SESSION_TABLE: &str = "session";
845 pub const NOTE_TABLE: &str = "note";834 pub const NOTE_TABLE: &str = "note";
846 pub const MESSAGE_TABLE: &str = "message";835 pub const MESSAGE_TABLE: &str = "message";
847 pub const NOTE_FILE_TABLE: &str = "note_file";836 pub const NOTE_FILE_TABLE: &str = "note_file";
src/db/enrollment.rsmodified+18 -1
@@ -112,7 +112,24 @@ pub async fn enroll(
112 .await?;112 .await?;
113 match row {113 match row {
114 Some(row) => Ok(Verdict::Made(row)),114 Some(row) => Ok(Verdict::Made(row)),
115- None => Ok(Verdict::Full),115+ None => {
116+ // A same-student racer whose held-check predated the winner's
117+ // commit queues on the role lock, wakes to a full roster, and
118+ // its own row is already the winner's: that is the replay,
119+ // not a refusal. Fresh snapshot per statement, so this read
120+ // sees the committed winner.
121+ let now_held = sqlx::query!(
122+ r#"SELECT 1 AS "one" FROM enrollment WHERE course = $1 AND app_user = $2"#,
123+ course_id.uuid(),
124+ user_id.uuid(),
125+ )
126+ .fetch_optional(&mut *tx)
127+ .await?;
128+ if now_held.is_some() {
129+ return Ok(Verdict::Held);
130+ }
131+ Ok(Verdict::Full)
132+ }
116 }133 }
117 })134 })
118 .await;135 .await;
tests/limits_completeness.rsmodified+0 -7
@@ -136,13 +136,6 @@ const EXCLUDED: &[(&str, &str)] = &[
136 "DEFAULT_DIETARY_TAGS",136 "DEFAULT_DIETARY_TAGS",
137 "settings seed; the live list is on GET /settings",137 "settings seed; the live list is on GET /settings",
138 ),138 ),
139- // The three migration batches and their list moved to
140- // `src/migration_sql.rs` — they are SurrealQL text, not bounds, and the
141- // numeric sweep below still catches any bound that tries to follow them.
142- ("USAGE_COUNTS_SQL", "one-statement bank usage-count query"),
143- // Storage-side keys and literals. Each names a row, a column value or a
144- // fold rule the server writes; none is a number a client is held to.
145- ("SETTINGS_KEY", "the settings singleton's record key"),
146 (139 (
147 "DECOY_PASSWORD",140 "DECOY_PASSWORD",
148 "login-decoy input, never a real credential",141 "login-decoy input, never a real credential",