Rambling: 26-02-18-2

Published 2026-02-18 15:35 Updated 2026-02-18 15:35 483 words 3 min read

碎碎念: 期末 · C碎碎念: 期末 · ARandom Notes: Summary of Several Recent Technical AdvancementsChitchat: Today is my birthday.Random Thoughts: Senior Year Coming-of-Age CeremonyRambling Thoughts: February 25, 2026Rambling Thoughts: February 26, 2022Random Thoughts: 26-02-20Rambling: 26-02-18-2Rambling: 26-02-18碎碎念: 26-02-17Rambling: 26-02-15Rambling Thoughts: 26-02-14Chatter: 26-01-16 Friends, Interpersonal RelationshipsRandom Thoughts: 26-01-01 2025, Annual ReviewRamblings: 2025-10-19Rambling: October 17, 2025 (Supplement)碎碎念: 2025-10-13 (补、密码保护)Rambling: Please forgive my introverted self.Rambling Thoughts: 2025-09-23Ramblings: Perfectly Transplanted PureSuck ThemeRambling Diary: 2025-07-16Trivial Musings: 2025-07-05Murmurings: 2025-06-13Random Thoughts: 2025-06-09Rambling Thoughts: 2025-05-18 A photo taken in the evening.Trivial Thoughts: 2025-05-05Rambling: 2025-04-30Chatty: 2025-04-20Chop Chop Nian: 2025-04-19Rambling: April 13, 2025Ramble: 2025-03-09-2Chatter: 2025-03-09Rambling: I'm too lazy to even write an annual summary.Random Thoughts: November 17, 2024Daily Musings: October 8, 2024, to October 18, 2024Ramblings: 2024-09-29Trivial Musings: September 24, 2024Random Thoughts: 2024-09-23Daily Ramblings: 2024-10-05Random Thoughts: 2024-10-03 Drank a taro boba milk teaRandom Thoughts: 2024-10-03 May the world be forever free from war.Rambling: 2024-09-15碎碎念: 2024-09-01Ramblings: 2024-08-29 Who changed my playlist?碎碎念: 2024-08-29 我抑郁症?Ramblings: 2024-08-29Chatter: 2024-08-26Chatter: 2024-08-22Random Thoughts: 2024-08-18Chatter: 2024-08-11Trivial Ramblings: 2024-08-08碎碎念: 2024-08-06 梦Chatter: 2024-08-06Chatter: 2024-08-04Murmurings: 2024-07-21Trivial Musings: July 13, 2024Ramblings: 2024-07-08Trivial Thoughts: 2024-07-03Murmurings: 2024-07-02Stream of Consciousness: July 1, 2024Rambling Thoughts: 2024-06-30Rambling Thoughts: June 28, 2024Chatter: 2024-06-27碎碎念: 2024-06-26Trivial Musings: 2024-06-22碎碎念: 2024-06-20Rambling: 2024-06-18Trivial Murmurs: 2024-06-17Random Thoughts: 2024-06-15Random Thoughts: June 14, 2024Rambling: 2024 High School Senior Rooftop Shouting碎碎念: 2024-06-06Chatter: 2024-05-30 1Random Thoughts: 2024-05-30 twoRambling Diary: 2024-05-27Rambling Thoughts: 2024-05-26碎碎念: 2024-05-23碎碎念: 2024-05-22Rambling Notes: 2024-05-19碎碎念: 2024-05-17Ramblings: 2024-05-14Rambling Thoughts: 2024-05-13Ramble: 2024-05-12碎碎念: 2024-05-10碎碎念: 2024-05-08碎碎念: 2024-05-06碎碎念: 2024-05-05 M:8 三碎碎念: 2024-05-05碎碎念: 2024-05-05 M:7 二Rambling Thoughts: 2024-05-05 M:7 OneRambling: May 2, 2024 Thursday M:3 light rain碎碎念: 生日Rambling: 2024-04-29 M:7Random Thoughts: 2024-04-27 M:8
I mentioned in my previous miscellaneous notes that there was a bug in the newly added link tracking (Link Tracking) and pixel tracking (Pixel Tracking) features of umami v3, and I attempted to fix it. Today I discovered that the bug wasn't completely resolved; sometimes pixel tracking data is still not recorded at all. Why did I think it was fixed yesterday? Because I found that after turning off IGNORE_IP, I opened the tracking links several times in the browser without any issues. I assumed the problem was with the IGNORE_IP code. After fixing IGNORE_IP, opening the tracking links in the browser could normally record the data. That's how I thought I had identified the issue.

Translated by AI model Qwen/Qwen3-8B.

Source Language: Simplified Chinese, Target Language: english, Translation Time: 2026-05-01 03:00

.

AI translation is for reference only. Accuracy is not guaranteed, please refer to the original text.

我在上篇碎碎念里提到了 umami v3 新增的链接追踪(Link Tracking)、像素追踪(Pixel Tracking)有 Bug,也尝试修复了一下。

今天发现,该 Bug 其实并没有完全修复,有时还是压根就没有记录到像素追踪的数据。

为什么昨天就以为修复了呢?因为我发现关了 IGNORE_IP 后,在浏览器打开了几次跟踪链接,都没有问题。就以为是 IGNORE_IP 的代码出了问题。修复了 IGNORE_IP 后,在浏览器打开跟踪链接,就可以正常记录到数据了。就这么以为找出了问题所在了。

然后今天我在无痕模式下打开跟踪链接,发现都没有记录到追踪的数据。又在 itdog 上测试了一下,看到统计数据还是 0。

然后炸毛了,这啥鬼!

再去翻看那鬼代码,不断地打日志(log),

src\app\api\send\route.ts 里,看到 await parseRequest(request, schema, { skipAuth: true }) 返回了个 {error},再继续在 parseRequest 的实现里打日志(log),发现是里面的 schema.safeParse(isGet ? query : body) 抛出了错误。从打的日志中可看到 "message": "Invalid input: expected string, received null"

2026-02-18 05:59:02.065 [error] 2026-02-18T05:59:02.063Z umami:my {
  success: false,
  error: Error [ZodError]: [
    {
      "expected": "string",
      "code": "invalid_type",
      "path": [
        "payload",
        "referrer"
      ],
      "message": "Invalid input: expected string, received null"
    }
  ]
      at new ZodError (.next/server/chunks/[root-of-the-server]__e72b30ae._.js:1:8143)
      at <unknown> (.next/server/chunks/[root-of-the-server]__e72b30ae._.js:1:21935)
      at e.safeParse (.next/server/chunks/[root-of-the-server]__e72b30ae._.js:20:8168)
      at h (.next/server/chunks/[root-of-the-server]__e72b30ae._.js:1859:308008)
      at async E (.next/server/chunks/[root-of-the-server]__4217576a._.js:11:35752)
      at async u (.next/server/chunks/[root-of-the-server]__68667959._.js:1:1731)
      at async u (.next/server/chunks/[root-of-the-server]__68667959._.js:1:4926)
}

到这里就可以看出,是上游的 payload.referrer 有问题,是 null。没检查 referrer 是否为空,就直接用了它。毕竟浏览器等不一定会发送 referrer,(例如 QQ 邮箱就不会发送 referrer)。

修改了 src\app$(collect)$(p/q)$[slug]\route.ts 的代码,应该 Bug 修复了吧?

If you enjoyed this, leave a comment~