8000 Make unknown variants visible as errors in jetdb-wasm instead of silent fallback values by dominion525 · Pull Request #197 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content

Make unknown variants visible as errors in jetdb-wasm instead of silent fallback values - #197

Merged
dominion525 merged 1 commit into
mainfrom
fix/wasm-unknown-variants
Oct 26, 2026
Merged

dominion525 merged 1 commit into
mainfrom
fix/wasm-unknown-variants

Conversation

@dominion525
Copy link
Copy Markdown
Owner

Summary

  • The wildcard arms on jetdb enums returned values the TypeScript types do not declare ("Unknown", kind "unknown", a column type name from the Display of jetdb, INVALID_FILE), null, or dropped values silently; an unknown variant now gives a NOT_SUPPORTED JetdbError
  • This covers column types, values, property values, complex columns, property maps, query types, VBA module types, and macro sources and statements, so columns, rows, queries, modules, formProperties, properties, macro, embeddedMacros and dataMacros throw it
  • PropertiesError is renamed to ReadError with a NotSupported variant, so one place maps it to a JavaScript error
  • An unknown kind of FileError gets the new code UNKNOWN_ERROR, added to the ErrorCode union and to docs/wasm in English and Japanese, since INVALID_FILE or NOT_SUPPORTED would tell a cause that may not be true
  • Every current variant behaves as before; the existing test checks the name of every column type, and the package smoke test reads every kind of value of the test data

🤖 Generated with Claude Code

@github-actions
github-actions Bot commented Oct 26, 2026 •
Copy link
Copy Markdown

Coverage

For d9b3647.

Filename                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
jetdb-cli/src/export.rs            144                10    93.06%           9                 1    88.89%          72                 5    93.06%           0                 0         -
jetdb-cli/src/form.rs              276                23    91.67%          24                 4    83.33%         158                 7    95.57%           0                 0         -
jetdb-cli/src/macro_cmd.rs         140                13    90.71%           7                 2    71.43%          64                 6    90.62%           0                 0         -
jetdb-cli/src/main.rs             1001                48    95.20%          86                 3    96.51%         611                25    95.91%           0                 0         -
jetdb-cli/src/prop.rs              443                16    96.39%          48                 2    95.83%         262                 8    96.95%           0                 0         -
jetdb-cli/src/query.rs              68                 3    95.59%           5                 0   100.00%          32                 0   100.00%           0                 0         -
jetdb-cli/src/vba.rs                62                 3    95.16%           5                 0   100.00%          28                 0   100.00%           0                 0         -
jetdb-wasm/src/lib.rs             4056               144    96.45%         268                 5    98.13%        2138                33    98.46%           0                 0         -
jetdb/src/catalog.rs               509                14    97.25%          46                 0   100.00%         299                 3    99.00%           0                 0         -
jetdb/src/complex.rs               924                32    96.54%          73                 0   100.00%         605                15    97.52%           0                 0         -
jetdb/src/crypto.rs               2300               112    95.13%         127                10    92.13%        1315                60    95.44%           0                 0         -
jetdb/src/csv.rs                   974                13    98.67%          77                 0   100.00%         557                 3    99.46%           0                 0         -
jetdb/src/data.rs                 4798                89    98.15%         299                 3    99.00%        2701                50    98.15%           0                 0         -
jetdb/src/ddl/access.rs             70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/mod.rs              2771                 8    99.71%         208                 2    99.04%        1501                 6    99.60%           0                 0         -
jetdb/src/ddl/mysql.rs              70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/postgres.rs           71                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/sqlite.rs             69                 0   100.00%           7                 0   100.00%          48                 0   100.00%           0                 0         -
jetdb/src/encoding.rs              285                 0   100.00%          30                 0   100.00%         153                 0   100.00%           0                 0         -
jetdb/src/file.rs                 1932                64    96.69%         118                 0   100.00%         989                18    98.18%           0                 0         -
jetdb/src/form.rs                 3332               133    96.01%         248                11    95.56%        1780                50    97.19%           0                 0         -
jetdb/src/form2000.rs              934                20    97.86%          73                 1    98.63%         497                 4    99.20%           0                 0         -
jetdb/src/format.rs                619                 2    99.68%          46                 0   100.00%         391                 2    99.49%           0                 0         -
jetdb/src/lib.rs                    14                 3    78.57%           2                 0   100.00%          11                 2    81.82%           0                 0         -
jetdb/src/macro_action.rs          299                19    93.65%          27                 3    88.89%         165                24    85.45%           0                 0         -
jetdb/src/macro_def.rs            2440                88    96.39%         196                 9    95.41%        1596                36    97.74%           0                 0         -
jetdb/src/macro_text.rs            804                24    97.01%          54                 2    96.30%         451                20    95.57%           0                 0         -
jetdb/src/map.rs                   417                13    96.88%          27                 0   100.00%         221                 5    97.74%           0                 0         -
jetdb/src/money.rs                 296                 0   100.00%          28                 0   100.00%         190                 0   100.00%           0                 0         -
jetdb/src/prop.rs                 1378                18    98.69%          91                 0   100.00%         698                10    98.57%           0                 0         -
jetdb/src/query.rs                2517                62    97.54%         201                 1    99.50%        1553                18    98.84%           0                 0         -
jetdb/src/relationship.rs          249                26    89.56%          22                 0   100.00%         177                10    94.35%           0                 0         -
jetdb/src/save_as_text.rs          574                27    95.30%          52                 3    94.23%         341                27    92.08%           0                 0         -
jetdb/src/storage.rs               766                32    95.82%          57                 0   100.00%         435                 6    98.62%           0                 0         -
jetdb/src/table.rs                1679                65    96.13%         109                 2    98.17%        1017                17    98.33%           0                 0         -
jetdb/src/timestamp.rs             491                 0   100.00%          51                 0   100.00%         285                 0   100.00%           0                 0         -
jetdb/src/vba.rs                   952                57    94.01%          83                11    86.75%         543                21    96.13%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                            38724              1181    96.95%        2825                75    97.35%       22022               491    97.77%           0                 0         -

…nt fallback values

- Give a NOT_SUPPORTED JetdbError for an unknown variant of a column type, a value, a property value, a complex column, a property map, a query type, a VBA module type, and a macro source or statement
- Name each current column type explicitly with the string it gives today, instead of relying on the Display of jetdb
- Turn the value conversions from From into TryFrom and pass the error up through columns, rows, queries, modules, formProperties, properties and the macro methods
- Rename PropertiesError to ReadError with a NotSupported variant, so one place maps it to a JavaScript error
- Give an unknown kind of FileError the new code UNKNOWN_ERROR instead of INVALID_FILE, and add it to the ErrorCode union
- Describe the new cases of NOT_SUPPORTED and UNKNOWN_ERROR in docs/wasm and the TypeScript comments

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dominion525
dominion525 force-pushed the fix/wasm-unknown-variants branch from 2ce1dc9 to d9b3647 Compare October 26, 2026 19:44
@dominion525
dominion525 merged commit 056da54 into main Oct 26, 2026
11 checks passed
@dominion525
dominion525 deleted the fix/wasm-unknown-variants branch October 26, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0