# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 16
# self = https://watcher.sour.is/conv/loerdxq
Hey @xuu any ideas why I don’t see Twts from @tiktok ?
Hey @xuu any ideas why I don’t see Twts from @tiktok ?
This seems to be a bit off:\n\n
\nDEBU[0007] cache: parsing https://feeds.twtxt.net/tiktok/twtxt.txt for tiktok\thttps://feeds.twtxt.net/tiktok/twtxt.txt\nDEBU[0007] twts: [I am @<tiktok https://feeds.twtxt.net/tiktok/twtxt.txt> an automated feed that twts every 30m with the current time (UTC) πŸ•’ The time is now seven thirty 🌞]\nDEBU[0007] new: []\nDEBU[0007] old: [πŸ•’ The time is now seven thirty 🌞 I am @<tiktok https://feeds.twtxt.net/tiktok/twtxt.txt> an automated feed that twts every 30m with the current time (UTC)]\n
This seems to be a bit off:


DEBU[0007] cache: parsing https://feeds.twtxt.net/tiktok/twtxt.txt for tiktok	https://feeds.twtxt.net/tiktok/twtxt.txt
DEBU[0007] twts: [I am @<tiktok https://feeds.twtxt.net/tiktok/twtxt.txt> an automated feed that twts every 30m with the current time (UTC) πŸ•’ The time is now seven thirty 🌞]
DEBU[0007] new: []
DEBU[0007] old: [πŸ•’ The time is now seven thirty 🌞 I am @<tiktok https://feeds.twtxt.net/tiktok/twtxt.txt> an automated feed that twts every 30m with the current time (UTC)]
This seems to be a bit off:\n\n
\nDEBU[0007] cache: parsing https://feeds.twtxt.net/tiktok/twtxt.txt for tiktok\thttps://feeds.twtxt.net/tiktok/twtxt.txt\nDEBU[0007] twts: [I am @<tiktok https://feeds.twtxt.net/tiktok/twtxt.txt> an automated feed that twts every 30m with the current time (UTC) πŸ•’ The time is now seven thirty 🌞]\nDEBU[0007] new: []\nDEBU[0007] old: [πŸ•’ The time is now seven thirty 🌞 I am @<tiktok https://feeds.twtxt.net/tiktok/twtxt.txt> an automated feed that twts every 30m with the current time (UTC)]\n
This seems to be a bit off:


DEBU[0007] cache: parsing https://feeds.twtxt.net/tiktok/twtxt.txt for tiktok	https://feeds.twtxt.net/tiktok/twtxt.txt
DEBU[0007] twts: [I am @<tiktok https://feeds.twtxt.net/tiktok/twtxt.txt> an automated feed that twts every 30m with the current time (UTC) πŸ•’ The time is now seven thirty 🌞]
DEBU[0007] new: []
DEBU[0007] old: [πŸ•’ The time is now seven thirty 🌞 I am @<tiktok https://feeds.twtxt.net/tiktok/twtxt.txt> an automated feed that twts every 30m with the current time (UTC)]
@xuu Commenting out pos-- in SplitTwts() seems to fix this, I've been debugging this for an hour or so now, but maybe you can confirm. I _smell_ an off-by-one error here? πŸ€” I'm just not 100% sure 🀣
@xuu Commenting out pos-- in SplitTwts() seems to fix this, I've been debugging this for an hour or so now, but maybe you can confirm. I _smell_ an off-by-one error here? πŸ€” I'm just not 100% sure 🀣
@xuu Commenting out pos-- in SplitTwts() seems to fix this, I've been debugging this for an hour or so now, but maybe you can confirm. I _smell_ an off-by-one error here? πŸ€” I'm just not 100% sure 🀣
Yes I _think_ the pos-- produces an "off-by-one" error here. Here's why I think this.

Say you have Twts: A, B, C, D ordered from oldest to newest (_from left to right_).

Let's say C and D exceed MaxTTLCache. Therefore pos lands on C and we break out of the loop. But if we decrement pos again here with pos--, then we pos points to B.

So we return new twts as A and old twts as B, C and D. Hence an off-by-one error since the older twtst were in fact C and D.

Make sense?
Yes I _think_ the pos-- produces an "off-by-one" error here. Here's why I think this.\n\nSay you have Twts: A, B, C, D ordered from oldest to newest (_from left to right_).\n\nLet's say C and D exceed MaxTTLCache. Therefore pos lands on C and we break out of the loop. But if we decrement pos again here with pos--, then we pos points to B.\n\nSo we return new twts as A and old twts as B, C and D. Hence an off-by-one error since the older twtst were in fact C and D.\n\nMake sense?
Yes I _think_ the pos-- produces an "off-by-one" error here. Here's why I think this.\n\nSay you have Twts: A, B, C, D ordered from oldest to newest (_from left to right_).\n\nLet's say C and D exceed MaxTTLCache. Therefore pos lands on C and we break out of the loop. But if we decrement pos again here with pos--, then we pos points to B.\n\nSo we return new twts as A and old twts as B, C and D. Hence an off-by-one error since the older twtst were in fact C and D.\n\nMake sense?
Yes I _think_ the pos-- produces an "off-by-one" error here. Here's why I think this.

Say you have Twts: A, B, C, D ordered from oldest to newest (_from left to right_).

Let's say C and D exceed MaxTTLCache. Therefore pos lands on C and we break out of the loop. But if we decrement pos again here with pos--, then we pos points to B.

So we return new twts as A and old twts as B, C and D. Hence an off-by-one error since the older twtst were in fact C and D.

Make sense?
Proposed fix: https://github.com/jointwt/twtxt/pull/377
Proposed fix: https://github.com/jointwt/twtxt/pull/377
Proposed fix: https://github.com/jointwt/twtxt/pull/377