OhGithubLost 4.2.0 · 预发布版 / 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·dioremoved 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 usesdart:io HttpClientdirectly (dio_net_transport.dartdeleted);diois gone frompubspec.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 sendsconnection: 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。
Addedre_editorplusre_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 thatdart:ioclassifies asunknown(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 —POSTis 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 byTabBarViewopen instantly without refetching. - P5 · 正常缺省不再报错:404(无 README / CNAME / Pages)降级为 WARN;
readme()直接请求/readme,去掉多出的一次 404 探测。
P5 — Expected absences (no README / CNAME / Pages) downgrade to WARN, andreadme()now calls/readmedirectly 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 leftoverthreadsActivefield 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’smaxSizepolicy. - 多语言(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.
下载 / Download
本版本共 19 个构件产物。
Android
| 文件 | 大小 |
|---|---|
| Android.AAB.zip | 56 MB |
| Android.arm64-v8a.zip | 9.5 MB |
| Android.armeabi-v7a.zip | 9.1 MB |
| Android.universal-APK.zip | 26 MB |
| Android.x86_64.zip | 9.7 MB |
Windows
| 文件 | 大小 |
|---|---|
| Windows.arm64-best-effort.zip | 12 MB |
| Windows.x64.zip | 13 MB |
Linux
| 文件 | 大小 |
|---|---|
| Linux.arm64-best-effort.zip | 10 MB |
| Linux.x64.zip | 11 MB |
macOS
| 文件 | 大小 |
|---|---|
| macOS.arm64.zip | 60 MB |
| macOS.x64.zip | 60 MB |
iOS
| 文件 | 大小 |
|---|---|
| iOS.device-arm64.zip | 8.7 MB |
| iOS.simulator.zip | 57 MB |
完整列表与校验信息见 Releases v4.2.0-alpha。