bluesky-social / feed-generator

ATProto Feed Generator Starter Kit
MIT License
847 stars 304 forks source link

RangeError: Could not decode varint error #73

Open maximesimoncelli opened 7 months ago

maximesimoncelli commented 7 months ago

Hello,

I'm currently implementing my own feed, and it works pretty well but I have these errors at random intervals:

repo subscription could not handle message RangeError: Could not decode varint
  at Object.read3 [as decode] (/home/bsky/app/node_modules/@atproto/repo/dist/index.js:13095:17)
  at readVarint (/home/bsky/app/node_modules/@atproto/repo/dist/index.js:24770:36)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async readHeader (/home/bsky/app/node_modules/@atproto/repo/dist/index.js:24775:19)
  at async decodeReaderComplete (/home/bsky/app/node_modules/@atproto/repo/dist/index.js:25015:40)

If a reproduction repo is needed, there you go: https://github.com/maximesimoncelli/dungeon-synth-bsky-feed For information, I encounter these errors on node 20, and I haven't tested it on older versions.

Thank you very much for your help :)

EddyLuten commented 7 months ago

@maximesimoncelli not sure why exactly, but after I ran npm i and npm audit fix in my feed app's directory, it's working again.

maximesimoncelli commented 7 months ago

@EddyLuten Thanks for the heads up. I will try to see what npm audit reports, maybe it is only a bug in one of the dependencies.

jeffgca commented 5 months ago

I've sen this in my own feed service:

repo subscription could not handle message RangeError: Could not decode varint
    at Object.read3 [as decode] (/Users/jeff/code/projects/bsky/posta/node_modules/node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js:17:13)
    at readVarint (/Users/jeff/code/projects/bsky/posta/node_modules/node_modules/.pnpm/@ipld+car@3.2.3/node_modules/@ipld/car/esm/lib/decoder.js:12:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async readHeader (/Users/jeff/code/projects/bsky/posta/node_modules/node_modules/.pnpm/@ipld+car@3.2.3/node_modules/@ipld/car/esm/lib/decoder.js:17:18)
    at async decodeReaderComplete (/Users/jeff/code/projects/bsky/posta/node_modules/node_modules/.pnpm/@ipld+car@3.2.3/node_modules/@ipld/car/esm/lib/reader-browser.js:51:28)

It doesn't seem to cause problems, I think it's just running into some data it doesn't like at the ipld level.

maximesimoncelli commented 5 months ago

I've sen this in my own feed service:

repo subscription could not handle message RangeError: Could not decode varint
    at Object.read3 [as decode] (/Users/jeff/code/projects/bsky/posta/node_modules/node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js:17:13)
    at readVarint (/Users/jeff/code/projects/bsky/posta/node_modules/node_modules/.pnpm/@ipld+car@3.2.3/node_modules/@ipld/car/esm/lib/decoder.js:12:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async readHeader (/Users/jeff/code/projects/bsky/posta/node_modules/node_modules/.pnpm/@ipld+car@3.2.3/node_modules/@ipld/car/esm/lib/decoder.js:17:18)
    at async decodeReaderComplete (/Users/jeff/code/projects/bsky/posta/node_modules/node_modules/.pnpm/@ipld+car@3.2.3/node_modules/@ipld/car/esm/lib/reader-browser.js:51:28)

It doesn't seem to cause problems, I think it's just running into some data it doesn't like at the ipld level.

Yep, no real problem, just a minor annoyance from time to time.