Skip to content

v4.2.0-alpha

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 03 Oct 10:16
· 120 commits to main since this release

OhGithubLost 4.2.0-alpha · 预发布 / Pre-release

主题 · Theme — 网络传输弃用 dio、代码编辑器换用成熟库、批量修复设备日志定位的 P2–P7。
Dropped dio, moved code viewing/editing to established packages, and fixed issues P2–P7 identified from on-device logs.

变更 · Changed

  • 网络传输弃用 dio · dio removed from the transport layer
    改为直接使用 dart:io HttpClient(新增 lib/base/net/io_net_transport.dart,删除 dio_net_transport.dart),pubspec.yaml 移除 dio;Actions 日志下载同步改写。原因:Dio 把连接策略藏在适配器层,排查与修复无法直接动手。
    Transport now uses dart:io HttpClient directly (dio_net_transport.dart deleted); dio is gone from pubspec.yaml, and Actions log downloads were rewritten too. Dio hid connection policy inside an adapter layer, which made both diagnosis and fixes hard to reach.
  • 禁用 keep-alive 连接复用 · Keep-alive reuse disabled
    每个请求 persistentConnection = false(请求头带 connection: close):设备日志反复出现 Connection closed before full header was received,而同一时刻原生自检全绿——差别只在是否复用连接。
    Every request now sends connection: close. Device logs repeatedly showed “Connection closed before full header was received” while native self-tests passed at the same moment — the only difference was connection reuse.
  • 连接类失败统一可重试 · Connection failures are retryable
    SocketException / HttpException 归为可重试的连接错误,重试前清空 DNS 缓存(避免钉在坏 IP 上)。
    Socket and HTTP exceptions are treated as retryable connection errors, and the DNS cache is cleared before retrying so clients do not stay pinned to a bad IP.
  • 代码查看与编辑换用成熟库 · Code view/editor on established packages
    新增 re_editor + re_highlight(highlight.js 的 Dart 移植),删除自研词法器与自绘渲染;语法高亮、行号、查找替换、撤销重做、折叠、快捷键全部由库提供,光标 / 换行 / 滚动不再错位;查看器与编辑器共用 OgLCodeViewer / OgLCodeField。
    Added re_editor plus re_highlight (a Dart port of highlight.js) and removed the hand-written lexer and custom renderer: highlighting, line numbers, find/replace, undo/redo, folding and shortcuts now come from the libraries, with caret/line-break/scroll misalignment gone. Viewer and editor share one rendering path.

修复 · Fixed

  • P2 · 未分类网络错误现在可重试:dart:io 把「连接在接收中被关闭」等场景归入 unknown,此前不可重试,大响应中途失败即终止;现纳入可重试类别(仍受「仅幂等方法」约束,POST 不会自动重试)。
    P2 — Errors that dart:io classifies as unknown (e.g. a connection closed mid-receive) are now retryable; previously a large response failing halfway aborted the operation. Retries still apply to idempotent methods only — POST is never retried automatically.
  • P3 · 仓库浏览不再绕过缓存:目录列表与文件读取原先一律 refresh: true,底座缓存永不命中;现默认走缓存,仅下拉刷新 / 写后回源。
    P3 — Directory listings and file reads no longer force a refresh, so the base-layer cache can finally hit; only pull-to-refresh and post-write reads go back to the network.
  • P4 · 切标签不再重复拉取:分页数据源新增「同目标 6 秒内的成功快照」,标签页被销毁重建时秒开。
    P4 — Paged data sources keep a 6-second success snapshot per target, so tabs destroyed and rebuilt by TabBarView open instantly without refetching.
  • P5 · 正常缺省不再报错:404(无 README / CNAME / Pages)降级为 WARN;readme() 直接请求 /readme,去掉多出的一次 404 探测。
    P5 — Expected absences (no README / CNAME / Pages) downgrade to WARN, and readme() now calls /readme directly instead of probing first and generating an extra 404.
  • P6 · 窗口日志节流:幽灵键盘 inset 高频抖动不再逐条落盘(同形态最多 1 秒 1 条)。
    P6 — Window-metric logging is throttled to at most one entry per second per shape, so phantom keyboard inset jitter no longer floods the log.
  • P7 · 重负载端点分页调小:发布 / Actions 每页 30 → 10,单次响应体积从数百 KB ~ 2 MB 降下来,弱网中断概率随之下降。
    P7 — Releases and Actions pages dropped from 30 to 10 items, shrinking a single response from hundreds of KB (up to 2 MB) and cutting the chance of a mid-transfer failure on weak networks.
  • 下载速率不再是假的 · Honest download speed
    移除旧自研分块下载器遗留的 threadsActive 字段(从未赋值);速率改为按库的进度事件差分估算(此前该字段恒为 0,界面显示的速率是假的)。
    Removed the leftover threadsActive field from the old in-house chunked downloader (never assigned); speed is now estimated by differencing progress events — previously the field was always 0, so the displayed rate was meaningless.

已知限制 · Known limitations

  • 本版本为预发布(pre-release):其成果随后并入 4.3.0 正式版;如只想取稳定产物,请用 4.3.0 或更高。
    This is a pre-release whose work was folded into 4.3.0; prefer 4.3.0 or newer for stable artifacts.
  • 编辑器高亮由库接管后,超大文本仍按库的 maxSize 策略退回纯文本。
    Very large files still fall back to plain text according to the library’s maxSize policy.
  • 多语言(R6)尚未开始:界面为中文。
    Localisation (R6) has not started yet — the UI is Chinese-only.

产物 · Artifacts

Android(arm64-v8a / armeabi-v7a / x86_64 / universal APK / AAB)、Windows、Linux、macOS、iOS —— 共 19 个文件。
Android (arm64-v8a / armeabi-v7a / x86_64 / universal APK / AAB), Windows, Linux, macOS, iOS — 19 files in total.