telescope
telescope copied to clipboard
Invalid Url makes backend/parser hang
What happened:
I pnpm start
to start the backend and this happened
[1647528556867] ERROR (1416 on DESKTOP-P67GFS3): Error queuing feeds
err: {
"type": "TypeError",
"message": "Invalid URL",
"stack":
TypeError [ERR_INVALID_URL]: Invalid URL
at new NodeError (node:internal/errors:371:5)
at onParseError (node:internal/url:552:9)
at parse (<anonymous>)
at new URL (node:internal/url:628:5)
at normalizeUrl (D:\Repos\telescope\node_modules\.pnpm\[email protected]\node_modules\normalize-url\index.js:99:17)
at urlToId (D:\Repos\telescope\src\api\parser\src\data\feed.js:22:31)
at Function.byUrl (D:\Repos\telescope\src\api\parser\src\data\feed.js:170:16)
at updateFeed (D:\Repos\telescope\src\api\parser\src\index.js:18:35)
at D:\Repos\telescope\src\api\parser\src\index.js:49:33
at Array.map (<anonymous>)
"input": "http:https:https://robertbegnatechblog.wordpress.com/category/open-source/feed",
"code": "ERR_INVALID_URL"
}
How to reproduce it (as precise as possible):
This happened because the url from the wiki feed was https:https://robertbegnatechblog.wordpress.com/category/open-source/feed
. It was passed to be hashed into an id
https://github.com/Seneca-CDOT/telescope/blob/80cee904c75b1c3dbeb9ebfb0ceeb77078ce3e3d/src/backend/data/feed.js#L24
But the url was invalid => it threw error
Environment:
- OS: Windows 10
- Browser: Chrome
This may be because of my local pc, will close if no one else has the problem