{"record":{"id":"aedf11140348c885","repo":"gastownhall/beads","slug":"parse-created-at-w","errorCode":null,"errorMessage":"parse created_at: %w","messagePattern":"parse created_at: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/notion/mapping.go","lineNumber":87,"sourceCode":"}\n\n// BeadsIssueFromPullIssue converts one pulled Notion issue into a beads core issue.\nfunc BeadsIssueFromPullIssue(issue PulledIssue, config *MappingConfig) (*types.Issue, error) {\n\tif config == nil {\n\t\tconfig = DefaultMappingConfig()\n\t}\n\n\tstatus := statusToBeads(issue.Status, config)\n\tpriority := priorityToBeads(issue.Priority, config)\n\tissueTypeRaw := issue.IssueType\n\tif strings.TrimSpace(issueTypeRaw) == \"\" {\n\t\tissueTypeRaw = issue.Type\n\t}\n\tissueType := typeToBeads(issueTypeRaw, config)\n\n\tcreatedAt, hasCreated, err := parseMappingTimestamp(string(issue.CreatedAt))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parse created_at: %w\", err)\n\t}\n\tupdatedAt, hasUpdated, err := parseMappingTimestamp(string(issue.UpdatedAt))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parse updated_at: %w\", err)\n\t}\n\tnow := time.Now().UTC()\n\tif !hasCreated {\n\t\tcreatedAt = now\n\t}\n\tif !hasUpdated {\n\t\tupdatedAt = createdAt\n\t}\n\n\tbeadsIssue := &types.Issue{\n\t\tID:           strings.TrimSpace(issue.ID),\n\t\tTitle:        strings.TrimSpace(issue.Title),\n\t\tDescription:  strings.TrimSpace(issue.Description),\n\t\tStatus:       status,","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/notion/mapping.go#L69-L105","documentation":"BeadsIssueFromPullIssue could not parse the pulled issue's CreatedAt string into a timestamp via parseMappingTimestamp. The wrap preserves the time parsing error (missing layout match). The input is issue.CreatedAt as a string, expected in the format produced by the Notion pull/export pipeline.","triggerScenarios":"CreatedAt containing a format outside the accepted layouts (e.g. 'yesterday', unix seconds, RFC1123, or a Notion date with different precision); an empty-but-non-nil string when the exporter expected absent (nil) for unknown; locale-formatted dates from hand-edited exports.","commonSituations":"Custom importer/pre-processor writing timestamps in a non-RFC3339 format; JSON produced by another tool with epoch-millis numbers serialized as strings; timezone names instead of offsets ('2024-01-01 10:00:00 EST'); truncated timestamps ('2024-01-01T10:').","solutions":["Read the wrapped time.ParseError: it names the offending value and the layouts tried.","Normalize the source data to RFC3339 (e.g. time.Time.UTC().Format(time.RFC3339)) before pulling.","If the field may be absent, set it to null/omit it so hasCreated=false kicks in rather than passing an unparseable string.","Check the parseMappingTimestamp accepted layouts and emit one of those formats in your exporter."],"exampleFix":"// before\nissue.CreatedAt = \"01/02/2024 10:00\" // unparseable\nbead, err := BeadsIssueFromPullIssue(issue, config) // parse created_at error\n\n// after\ncreated, _ := time.Parse(\"01/02/2006 15:04\", \"01/02/2024 10:00\")\nissue.CreatedAt = types.String(created.UTC().Format(time.RFC3339))","handlingStrategy":"validation","validationCode":"if _, err := time.Parse(time.RFC3339, createdAt); err != nil {\n    return fmt.Errorf(\"invalid created_at %q: %w\", createdAt, err)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"parse created_at\") {\n    log.Printf(\"bad created_at value from source: %v\", err)\n}","preventionTips":["Always emit RFC3339 UTC timestamps from exporters/importers.","Leave the field empty/null when unknown instead of writing placeholder strings.","Validate source JSON timestamps in importer tests."],"tags":["notion","mapping","timestamp","parse-error"],"backgroundTag":"timestamp-parse-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}