Skip to content

fix: resolve JSON and SQLite trimming warnings - #10513

Merged
2dust merged 1 commit into
2dust:masterfrom
aleksandr-miheichev:codex/fix-json-sqlite-aot-warnings
Nov 4, 2026
Merged

2dust merged 1 commit into
2dust:masterfrom
aleksandr-miheichev:codex/fix-json-sqlite-aot-warnings

Conversation

@aleksandr-miheichev

@aleksandr-miheichev aleksandr-miheichev commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

JsonUtils and SQLiteHelper call reflection-discovering serializer and ORM overloads, producing trimming/AOT diagnostics even though the application already has generated JSON metadata and concrete mapped entity types.

Pass JsonTypeInfo from the existing configured resolver to JSON operations, preserving their options and failure results. Propagate mapped-type metadata through generic SQLite helpers, pass explicit types/mappings to CRUD operations, and use typed transactional bulk loops preserving affected counts, OR REPLACE behavior and rollback. Existing write callers use concrete entities or typed collections; mappings now follow the declared generic type.

Extracted from PR 10499 at the maintainer's request. Production changes are limited to JsonUtils.cs and SqliteHelper.cs. Focused tests cover serialization options, deep copies, CRUD counts and transactional failures; small existing-test changes make their assertions/SQLite calls AOT-safe and preserve correct test-listener shutdown ordering. The UI editor-model rework remains separate in PR 10499.

Validation of source tree 5ea5ad0ace635d903287013f183e7cb36b99e583 (c3ff0a36):

  • ServiceLib AOT analysis with IL2026 treated as an error: zero warnings/errors on Windows and Linux. The unchanged upstream baseline produced 12 IL2026 errors and nine metadata warnings under the Windows check.
  • Complete managed suites passed 200/200 ServiceLib and 402/402 WebAPI on Windows and WSL/Linux, without skips. The final test-only listener ordering change was additionally covered by the rebuilt native suite.
  • Actual Windows x64 NativeAOT executable: 200/200, no failures/skips, with no publish warnings. Its initial run reproduced the existing test listener disposal race, 199/200; the ordering fix is included and that failure remains recorded.
  • Upstream CI for c3ff0a36 passed: Code Test ran 200/200 ServiceLib tests on Linux x64; WebAPI ran 200/200 ServiceLib and 402/402 WebAPI tests on Windows x64, Windows ARM64, Linux x64 and macOS ARM64, with zero failures or skips. Both runs checked out a synthetic merge whose source tree matches c3ff0a36.
  • Independent read-only review found no material issues. No warning suppressions, package upgrades, entity changes or workflow changes are included. UI binding and ProDataGrid warnings are outside this PR.

Use generated JSON type metadata and propagate mapped SQLite types through CRUD and transactional bulk operations. Cover serialization options, affected counts, rollback and native test compatibility without changing UI models or persistence entities.
@2dust
2dust merged commit 9a029a3 into 2dust:master Nov 4, 2026
11 checks passed
@aleksandr-miheichev
aleksandr-miheichev deleted the codex/fix-json-sqlite-aot-warnings branch November 4, 2026 12:52
patterniha added a commit to patterniha/PattN that referenced this pull request Nov 11, 2026
Brings in 2dust/v2rayN up to e3457fa (still 7.25.6):
- Native AOT (2dust#10295, 2dust#10513): JSON through a source-generated
  context, trimming roots, and AOT zips of the Windows desktop, Linux
  and macOS builds; ReactiveUI 26 (2dust#10249) and ProDataGrid (2dust#10347);
- a pre-resolver per subscription (2dust#10220), MASQUE WARP (2dust#10498), the
  XDRIVE transport (2dust#10546), sing-box TUN dns_mode (2dust#10336) and an AUTO
  bind interface (2dust#10519);
- the download refactor with Downloader 6 (2dust#10534), subscription
  profiles kept on a failed import (2dust#10429), repeated test results
  kept (2dust#10466), share-link fixes (2dust#10504, 2dust#10505, 2dust#10520, 2dust#10526),
  udphop (2dust#10550), REALITY fragments (2dust#10428), and the WebAPI's
  restart deadline (2dust#10516) and macOS instance lock (2dust#10454);
- Linux packages cross-built for x64, arm64, riscv64, ppc64le and
  loong64 in one job, plus x86 packages (2dust#10487, 2dust#10537), and a daily
  certificate update workflow (2dust#10497).

Where upstream changed code PattN had changed:
- no IPv6 FakeIP setting (2dust#10464): PattN writes no fakedns block, so
  Xray-core uses its default IPv4 and IPv6 pools, and sing-box gets an
  IPv6 range on its own; FakeIPUtils and its tests go;
- 2dust#10485's DNS change is not taken: PattN asks each direct group's
  servers in turn and ends the query on the last;
- the TUN inbound copies the inbound's sniffing (2dust#10460) without
  forcing routeOnly;
- MASQUE: upstream's editor and import, which no longer clear or lock
  the TLS options: the fork core speaks HTTP/2 over TLS when the ALPN
  has h2 but not h3, so they apply there;
- the WebAPI restart: upstream's polling fix (2dust#10516) replaces PattN's
  own wait.

Adapted to the AOT JSON and the download refactor: Aether's DNS, the
share-link JSON options, the outbound tag check and the Psiphon test
fixtures go through the source-generated context; the Aether test only
says whether to measure speed, and its IP lookup uses a download
service on the tunnel's proxy; the rule-set 404 skip moves into the new
download helper.

Release workflows and Linux packaging scripts take upstream's layout
with PattN's names and bundles: every Linux architecture builds on each
release (exotic_arch is gone; patterniha/Aether has builds for x64 and
arm64 only), the deb packages keep the cores' execute bits (2dust#10335),
which 2dust#10537's rewrite dropped, and the certificate workflow runs only
upstream.

Conflicts:
- resx: both sets of strings.
- SubEditWindow: upstream's pre-resolver row among PattN's rows.
- AddServerViewModelTests: upstream's; PattN's preset tests move to
  AddServerViewModelPresetTests.
- CoreConfigV2rayIPNetworkTests: without upstream's fakedns pool test.
- README: PattN's.
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.

2 participants