Title: [Order 05][P2] Harden duplicate detection and null binary materialization · Issue #62 · NEventStore/NEventStore.Persistence.SQL · GitHub
Open Graph Title: [Order 05][P2] Harden duplicate detection and null binary materialization · Issue #62 · NEventStore/NEventStore.Persistence.SQL
X Title: [Order 05][P2] Harden duplicate detection and null binary materialization · Issue #62 · NEventStore/NEventStore.Persistence.SQL
Description: Priority order Order: 05 of 09 Priority: P2 correctness Problem Provider error handling and binary materialization have fragile edge cases. Evidence: src/NEventStore.Persistence.Sql/SqlDialects/MySqlDialect.cs:43 MySQL duplicate detectio...
Open Graph Description: Priority order Order: 05 of 09 Priority: P2 correctness Problem Provider error handling and binary materialization have fragile edge cases. Evidence: src/NEventStore.Persistence.Sql/SqlDialects/MyS...
X Description: Priority order Order: 05 of 09 Priority: P2 correctness Problem Provider error handling and binary materialization have fragile edge cases. Evidence: src/NEventStore.Persistence.Sql/SqlDialects/MyS...
Opengraph URL: https://github.com/NEventStore/NEventStore.Persistence.SQL/issues/62
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Order 05][P2] Harden duplicate detection and null binary materialization","articleBody":"## Priority order\n\nOrder: 05 of 09\nPriority: P2 correctness\n\n## Problem\n\nProvider error handling and binary materialization have fragile edge cases.\n\nEvidence:\n\n- `src/NEventStore.Persistence.Sql/SqlDialects/MySqlDialect.cs:43`\n- MySQL duplicate detection reflects a `Number` property and immediately casts it.\n- `src/NEventStore.Persistence.Sql/CommitExtensions.cs:87`\n- `GetByteArray` returns `[default]` for `null`/`DBNull.Value`.\n\n## Impact\n\n- MySQL can mask non-provider exceptions with `NullReferenceException` or invalid casts during error handling.\n- Nullable `Headers` values can be deserialized from one zero byte instead of returning default, which can fail for legacy rows or manually inserted rows.\n\n## Mandatory test-first workflow\n\n- Add tests first to reproduce or verify each behavior.\n- Add a unit test proving `MySqlDialect.IsDuplicate(new Exception(...))` returns false and does not throw.\n- Add a materialization test for a commit row with `Headers = NULL`.\n- Do not change production code until the tests capture the expected behavior.\n\n## Proposed action\n\n- Guard MySQL `IsDuplicate` for missing or non-int `Number`.\n- Prefer provider-specific exception checks where available.\n- Return `[]` for `null` and `DBNull.Value` in `GetByteArray`.\n\n## Acceptance criteria\n\n- Duplicate detection does not throw for unrelated exception types.\n- Null headers materialize as default/empty headers behavior without deserialization failure.\n- Existing duplicate-commit behavior remains covered.\n\nSource: `docs/Project-Analysis-Issue-Drafts.md`.","author":{"url":"https://github.com/AGiorgetti","@type":"Person","name":"AGiorgetti"},"datePublished":"2026-06-11T09:21:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/62/NEventStore.Persistence.SQL/issues/62"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f9a4e927-1829-5b5c-6e66-6ecab2a565a0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB1C:4D341:10BE908:166D943:6A4D8BDB |
| html-safe-nonce | 57489fe71f6ca7e90cc53bf1db6846ba68294cd3459d77401c2828dd402c908b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjFDOjREMzQxOjEwQkU5MDg6MTY2RDk0Mzo2QTREOEJEQiIsInZpc2l0b3JfaWQiOiI1Mjc5ODI5MTQ1ODY5NDU0Mjk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0a5312d06163615e0957e305435c89e42b5c450e892741ae272703afd11a26c8 |
| hovercard-subject-tag | issue:4639065490 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NEventStore/NEventStore.Persistence.SQL/62/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f98a93e64667a7ad30bb1fe6b4289cce535d6ce87e46cc1437fe74756a8c25ec/NEventStore/NEventStore.Persistence.SQL/issues/62 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f98a93e64667a7ad30bb1fe6b4289cce535d6ce87e46cc1437fe74756a8c25ec/NEventStore/NEventStore.Persistence.SQL/issues/62 |
| og:image:alt | Priority order Order: 05 of 09 Priority: P2 correctness Problem Provider error handling and binary materialization have fragile edge cases. Evidence: src/NEventStore.Persistence.Sql/SqlDialects/MyS... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AGiorgetti |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9f8758a3953dfe943439713a6fa4f90d542a3431f10e861ca03dd7f39009f320 |
| turbo-cache-control | no-preview |
| go-import | github.com/NEventStore/NEventStore.Persistence.SQL git https://github.com/NEventStore/NEventStore.Persistence.SQL.git |
| octolytics-dimension-user_id | 4486767 |
| octolytics-dimension-user_login | NEventStore |
| octolytics-dimension-repository_id | 36130556 |
| octolytics-dimension-repository_nwo | NEventStore/NEventStore.Persistence.SQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36130556 |
| octolytics-dimension-repository_network_root_nwo | NEventStore/NEventStore.Persistence.SQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bffd5484f01713a661b03469b77678f72b6574ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width