🧮 USERS:1 FEEDS:2 TWTS:1572 ARCHIVED:91682 CACHE:2767 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1571 ARCHIVED:91670 CACHE:2760 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1570 ARCHIVED:91649 CACHE:2746 FOLLOWERS:22 FOLLOWING:14
@zvava@twtxt.net By hashing definition, if you edit your message, it simply becomes a new message. It’s just not the same message anymore. At least from a technical point of view. As a human, personally I disagree, but that’s what I’m stuck with. There’s no reliable way to detect and “correct” for that.
Storing the hash in your database doesn’t prevent you from switching to another hashing implementation later on. As of now, message creation timestamps earlier than some magical point in time use twt hash v1, messages on or after that magical timestamp use twt hash v2. So, a message either has a v1 or a v2 hash, but not both. At least one of them is never meaningful.
Once you “upgrade” your database schema, you can check for stored messages from the future which should have been hashed using v2, but were actually v1-hashed and simply fix them.
If there will ever be another addressing scheme, you could reuse the existing hash column if it supersedes the v1/v2 hashes. Otherwise, a new column might be useful, or perhaps no column at all (looking at location-based addressing or how it was called). The old v1/v2 hashes are still needed for all past conversation trees.
In my opinion, always recalculating the hashes is a big waste of time and energy. But if it serves you well, then go for it.
🧮 USERS:1 FEEDS:2 TWTS:1569 ARCHIVED:91625 CACHE:2729 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1568 ARCHIVED:91619 CACHE:2724 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1567 ARCHIVED:91603 CACHE:2716 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1566 ARCHIVED:91599 CACHE:2716 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1565 ARCHIVED:91587 CACHE:2720 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1564 ARCHIVED:91574 CACHE:2724 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1563 ARCHIVED:91568 CACHE:2720 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1562 ARCHIVED:91560 CACHE:2721 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1561 ARCHIVED:91551 CACHE:2715 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1560 ARCHIVED:91547 CACHE:2731 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1559 ARCHIVED:91540 CACHE:2736 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1558 ARCHIVED:91536 CACHE:2746 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1557 ARCHIVED:91529 CACHE:2761 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1556 ARCHIVED:91526 CACHE:2762 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1555 ARCHIVED:91509 CACHE:2755 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1554 ARCHIVED:91491 CACHE:2765 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1553 ARCHIVED:91490 CACHE:2765 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1552 ARCHIVED:91485 CACHE:2763 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1551 ARCHIVED:91481 CACHE:2776 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1550 ARCHIVED:91471 CACHE:2773 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1549 ARCHIVED:91450 CACHE:2788 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1548 ARCHIVED:91437 CACHE:2799 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1547 ARCHIVED:91420 CACHE:2800 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1546 ARCHIVED:91405 CACHE:2800 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1545 ARCHIVED:91398 CACHE:2804 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1544 ARCHIVED:91389 CACHE:2800 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1543 ARCHIVED:91380 CACHE:2795 FOLLOWERS:22 FOLLOWING:14
Hmmmm the AoC site is not mobile friendly 😢
Can someone post the puzzles as Twts? 🤣
🧮 USERS:1 FEEDS:2 TWTS:1542 ARCHIVED:91362 CACHE:2785 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1541 ARCHIVED:91350 CACHE:2778 FOLLOWERS:22 FOLLOWING:14
@lyse@lyse.isobeef.org Damn. That was stupid of me. I should have posted examples using 2026-03-01 as cutoff date. 😂
In my actual test suite, everything uses 2027-01-01 and then I have this, hoping that that’s good enough. 🥴
def test_rollover():
d = jenny.HASHV2_CUTOFF_DATE
assert len(jenny.make_twt_hash(URL, d - timedelta(days=7), TEXT)) == 7
assert len(jenny.make_twt_hash(URL, d - timedelta(seconds=3), TEXT)) == 7
assert len(jenny.make_twt_hash(URL, d - timedelta(seconds=2), TEXT)) == 7
assert len(jenny.make_twt_hash(URL, d - timedelta(seconds=1), TEXT)) == 7
assert len(jenny.make_twt_hash(URL, d, TEXT)) == 12
assert len(jenny.make_twt_hash(URL, d + timedelta(seconds=1), TEXT)) == 12
assert len(jenny.make_twt_hash(URL, d + timedelta(seconds=2), TEXT)) == 12
assert len(jenny.make_twt_hash(URL, d + timedelta(seconds=3), TEXT)) == 12
assert len(jenny.make_twt_hash(URL, d + timedelta(days=7), TEXT)) == 12
(In other words, I don’t care as long as it’s before 2027-01-01. 😏😅)
@shinyoukai@neko.laidback.moe What do you mean by that? 🧐 Clients don’t care about the order of twts in a feed. For display clients usually sort by timestamp.
🧮 USERS:1 FEEDS:2 TWTS:1540 ARCHIVED:91337 CACHE:2777 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1539 ARCHIVED:91318 CACHE:2764 FOLLOWERS:22 FOLLOWING:14
Oh my god! 🤣 It works! 🥳 My first Twt into the Fediverse (stil some improvements to be made of course), but still 😳 Wow! 🤩 
The funny thing is, Yarn moving to Twt Hash v2 sounds a tad more optimistic than Git adopting SHA-256.
Git is several years too late, while Yarn is pretty much on time.
🧮 USERS:1 FEEDS:2 TWTS:1538 ARCHIVED:91283 CACHE:2735 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1537 ARCHIVED:91256 CACHE:2715 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1536 ARCHIVED:91242 CACHE:2727 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1535 ARCHIVED:91224 CACHE:2741 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1534 ARCHIVED:91215 CACHE:2746 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1533 ARCHIVED:91209 CACHE:2755 FOLLOWERS:22 FOLLOWING:14
All my newly added test cases failed, that movq thankfully provided in https://git.mills.io/yarnsocial/twtxt.dev/pulls/28#issuecomment-20801 for the draft of the twt hash v2 extension. The first error was easy to see in the diff. The hashes were way too long. You’ve already guessed it, I had cut the hash from the twelfth character towards the end instead of taking the first twelve characters: hash[12:] instead of hash[:12].
After fixing this rookie mistake, the tests still all failed. Hmmm. Did I still cut the wrong twelve characters? :-? I even checked the Go reference implementation in the document itself. But it read basically the same as mine. Strange, what the heck is going on here?
Turns out that my vim replacements to transform the Python code into Go code butchered all the URLs. ;-) The order of operations matters. I first replaced the equals with colons for the subtest struct fields and then wanted to transform the RFC 3339 timestamp strings to time.Date(…) calls. So, I replaced the colons in the time with commas and spaces. Hence, my URLs then also all read https, //example.com/twtxt.txt.
But that was it. All test green. \o/
🧮 USERS:1 FEEDS:2 TWTS:1532 ARCHIVED:91202 CACHE:2757 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1531 ARCHIVED:91198 CACHE:2766 FOLLOWERS:22 FOLLOWING:14
🧮 USERS:1 FEEDS:2 TWTS:1530 ARCHIVED:91190 CACHE:2765 FOLLOWERS:22 FOLLOWING:14