@@ -193,12 +193,13 @@ fn init_db(db sqlite.DB) ! {
193193 delete_token text not null,
194194 created_at text not null,
195195 remote_ip text not null,
196- user_agent text not null,
197- c_file_name text not null,
198- target_os text not null,
199- ccompiler text not null,
200- error_string text not null
201- )' )!
196+ user_agent text not null,
197+ c_file_name text not null,
198+ target_os text not null,
199+ ccompiler text not null,
200+ error_string text not null,
201+ lines text not null
202+ )' )!
202203 db.exec ('create index if not exists idx_bug_reports_created_at
203204 on bug_reports(created_at)' )!
204205}
@@ -220,13 +221,14 @@ pub fn (mut app App) create(mut ctx Context) veb.Result {
220221 return ctx.request_error ('unsupported report kind' )
221222 }
222223 stored_report := vbugreport.new_stored_c_error_report (report.c_file, report.target_os,
223- report.ccompiler, report.c_error)
224+ report.ccompiler, report.c_error, report.c_context.map (it .text),
225+ report.v_context.map (it .text))
224226 id := new_report_id ()
225227 delete_token := rand.uuid_v4 ()
226228 app.db.exec_param_many ('insert into bug_reports (
227229 id, delete_token, created_at, remote_ip, user_agent,
228- c_file_name, target_os, ccompiler, error_string
229- ) values (?, ?, ?, ?, ?, ?, ?, ?, ?)' , [
230+ c_file_name, target_os, ccompiler, error_string, lines
231+ ) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ? )' , [
230232 id,
231233 delete_token,
232234 time.utc ().format_rfc3339 (),
@@ -236,6 +238,7 @@ pub fn (mut app App) create(mut ctx Context) veb.Result {
236238 stored_report.target_os,
237239 stored_report.ccompiler,
238240 stored_report.error_string,
241+ stored_report.lines,
239242 ]) or { return ctx.server_error ('could not store report' ) }
240243 return ctx.json (CreateBugReportResponse{
241244 id: id
0 commit comments