by fouronnes3 · 1y ago · 0 comments
I have a similar bug at my job: Sometimes browsers delete our extension's database, or otherwise corrupt it. It's been an issue for years, but no one has been able to reproduce it. It's probably a 1 in 10 million bug.
I think it's a hardware bug. My "fix" was to backup a small, but key, part of the database to a separate storage mechanism browsers let us access. When the issue arises we can now try to detect the missing data and restore part of the db.
BUT! If this is actually a hardware bug, there is a chance that this additional database write will cause this big to occur even more often, as we now have to write to storage twice as often!
Are any of the bug reporters using Vivaldi? As for some reason that browser allows (and enables by default) clearing extension storage when clearing history/cookies via Delete Browsing Data.
This is something the Stylus addon dev noted when a user was reporting the addon wasn't remembering their settings and it was because the user had unwittingly wiped the extension storage due to the browser defaults.
(I actually use Vivaldi myself but virtually never use that feature so was unaware of the behavior until reading about the bug report)
No user that has reported it has been willing to share their database with us (chrome stores it in a standard leveldb), as it contains private information.
But good to know that about Vivaldi! I didn't know that before, thanks!
Even if the bug is fiendishly hard to track down and reproduce, you'd think there would be some additional safety checks they could add that would at least let it fail with an error message instead of actual data loss.
An acquaintance of mine were twice hit with a bug that corrupted Word documents stored on iCloud if editing on her iPad. Searching online yielded others with the same problem from more than one year ago...
> Being open or closed source has nothing to do with hearing about problems.
Also, pay attention to observation bias and userbase bias.If my dad faced this issue, he'd never post online. He'd call me or go to a computer repair shop. That's what your average user will do.
Open Source users tend to be a bit more tech savvy. There's that famous article about Linux gamers reporting way more bugs than average users and how it can be accidentally misinterpreted as "why develop for linux?" These frequency biases are a big part of this. Pluus, OSS tends to do better bug tracking.
> you'd think there would be some additional safety checks they could add that would at least let it fail with an error message instead of actual data loss.
My guess is that these would exist, and do.I think you've just made an assumption about a bug that was reported 17 years ago. Assuming nothing has been done since. It looks like they can't reproduce it, *making it impossible to mark as fixed* even if it was. But I wouldn't assume nothing was done.
Also remember that Gmail, Outlook, and others are in play here. They also maintain trashed items for 30 days, making it easy to recover. As the provider, they shouldn't make it easy to mass delete things either, right? TB is just the interface, frankly, I'm not sure I know how to permanently delete emails with it. I'm not sure I can. But the interaction here should result in multiple lines of defense.
No, not at all. It's very easy.
This bug involves taking an inappropriate action under corrupted conditions. You don't need to know how those conditions arose. All you have to do is check whether they currently obtain, and - if so - refrain from taking the inappropriate action.
For this bug, that looks like this:
1. When we're executing a "move"...
2. Before deleting the original messages...
3. Check whether the copies are identical to the originals...
4. And if not, delete the copies instead of the originals.
At this point, the bug can't occur. The "root cause" bug, where your buggy logic says that you copied a bunch of messages even though you didn't, can still occur, but it can no longer delete any messages.
> it is almost impossible to fix a bug you can't reproduce
It's also impossible to mark a bug report as resolved if you can't reproduce it.You could have fixed the bug (especially since a lot of TB was rewritten) but if you can't reproduce the bug you wouldn't know it was solved only that people stopped reporting it. This is actually a common occurrence with long standing bugs.
It's a genuine question because I'm puzzled here.
A very small number of users have this bug (and tbf, it's a really bad bug), and are unable to consistently reproduce it and it seems none of the developers have been able to (the seemingly random nature of the bug occurring is not helping). How is it supposed to be fixed?
- You can extend logging to gather additional information to reproduce it.
- You can try to reason about the code and figure out possible causes.
- You can attempt to formally verify the correctness of the code.
- You can put guards into the code against unexpected states and actions.
- You can verify the correct result of previous actions before any destructive actions.
- If all fails you can scrap the piece of code in question since it seems to be beyond your ability to maintain.
You strangle it from the edges.
Why I'm surprised is... well... this is HN. We know that a bug like this is very rare, right? I mean otherwise who would ever use TB, right? But if it's rare, it's really hard to track down. There years of comments without people including system information. The reproduction steps themselves are "sometimes." It's HN, so we can assume users here program, right? How would you solve this use?
FWIW, I've used TB on Linux and OSX for years and never faced an issue like this. The only one I've faced is sometimes not being able to connect to the server and having to resend an email.
On the other hand, when using Apple Mail:
- messages routinely doesn't show me messages I can see in TB.
- Frequently sending messages from my phone doesn't go through or ends up double sending.
- Searching will pull up emails from a year ago, prioritizing them over the email I got this week and was actually looking for (e.g. searching foo@bar.com).
- I can't even tag emails!?!?
- Do filters even work? Holy cow how do people live without filters!? How do you deal with spam? How do you deal with all those noisy needless messages and newsletter type of stuff that won't let you unsubscribe or comes from domains or addresses you can't block because emails you need come from the same addresses?
- It straight up renders PDFs inline with no warning, helping spammers.
- There's no folders and everything is just all jumbled together in a mess. How does anyone find anything?
Idk, this is an annoying problem but I'd be surprised if I lost all my emails. I can recover deleted emails in Gmail and Outlook. Annoying, but recovering these (go to trash, click "restore") is far less time than what I'm saving on a weekly basis with TB.I know these problems aren't on all platforms but TB IME has saved me a ton of time compared to using Gmail, Outlook, or Apple Mail. Hell, fucking Neomutt is a better experience than those three, which is insane. Trying to use them is like trying to use the internet without an ad blocker. How are we so bad at email?
When I updated the configuration in K-9, it contacted the fastmail server, found that the mail it had locally wasn't also present there, and immediately deleted all my local copies.
That's not a "bug" in the sense of unintended behavior of the software, but it certainly seems like the software designer's goal is to hurt the user. I obviously didn't want that to happen. There is no scenario where I would want that to happen.
Email clients make some strange assumptions about what kind of actions make sense under what conditions.
I've so often had debates and threads in issues where a developer entrenched in a domain has so much domain-knowledge (ie. tunnel vision) that "technically correct" or "by the spec" is the only correct way. I've been that developer in many cases too, in hindsight.
So if you want a mailbox sync tool, use a proper program for that like mbsync/isync. (But this can't cope with cross mailbox moves besides (not) propagating them.)
Another example is HTTP Strict-Transport-Security which specifies that browsers should take control away from users.
It's another thing that got me interested in DDD. Where the user, domain, business and such define what things are called, how they operate, what events they undergo or emit etc. And not a spec, language or framework
And where e.g. "the IMAP spec" is a clear bounded domain, probably a service, an adapter or even library. Within that domain, "The Spec" dictates all the naming, conventions, logic etc, but where the border of this domain is another language. E.g. in a "MessageAdapterImap" something is called "EXPUNGE" with all the intricacies of what this means in IMAP. But in the outside it's e.g. part of a "cleanup()" interface, or whatever the domain calls it when it removes messages.
1. Copy from source to destination
2. Verify copy has completed without issue
3. Delete from source
but... some other way? So when you try to move from a server folder to a local client folder by an innocent looking drag an drop, combine this with a poor network connection, a garbage tier legacy protocol like IMAP and decade old C++ spaghetti code, and you get this textbook 17 year old severity 1 bug that will never get fixed.
(see https://bugzilla.mozilla.org/show_bug.cgi?id=462156#c69 )
Of course, it isn't; they're relying on an unstable proxy for "copy has completed without issue" in preference to just checking whether that happened or not. Several rather angry users have pointed this out. It doesn't seem to have sunk in.
> How is it not top 1 priority to fix it?
Maybe because it is very rare? I have been using thunderbird for 10 years now on various OSes and never had issues.
Emails to email client is an engine to the car. It is pointless without one and it is THE purpose of it. All the rest of functionality like fancy UI, filter, notifications, editor is meaningless if your emails were deleted without recovery. Even car without engine is more useful than email client with empty DB.
That said, even if the bug is impossible to isolate, it sounds like the chain of events that leads to it is known. They probably should disable the feature until someone is motivated to fix or replace the code. I'm sure that would anger a lot of people, but someone angry about the loss of a feature is probably better than someone who is angry at the loss of data. Especially given that the feature seems to be something someone would use to archive their mail.
I wont be using any email client that can break and delete all my emails from local and the server. Why would i? It may be a lottery but it isnt one i want to play.
The fact that they see this as low priority shows theyre morons.
Who would say 'yes please' to an email client that might permanently destroy some of your most important data at random?
Far too focused on the engineering POV than the optics and trust/reputation damage. My kind of moronic, but still moronic.
I have no good alternative to thunderbird, it does so much of what I want. But this bug is awful.
But OP said it also deletes the message in the server, so it may be a different bug, right?
Even if the software doesn't have known bugs, I do it if the data is important enough and especially if I were to not have a backup (for example, because the storage provider takes care of backups and redundancy. I personally like to have another copy that I manage myself, but how many people have their IMAP emails or Spotify playlist data backed up for example? I do, but not many people I think)
As a software developer fixing stuff like this is only possible if you can reproduce it or otherwise get logs, telemetry and similar things, otherwise it is pretty much just guesswork.
Granted given the severity of the consequences I would've chosen a more defensive move-strategy (e.g. one that deletes mails only once they have been copied verifiably), but that would have significant performance impacts in the 99.99% of cases where it works, so finding the real problem is preferable.
The truth is that if this happens to you regularly, that you are probably the prime person to gather more data on this. Call it giving back to Open Source software.
As a software developer you should be able to reason about your code and work backwards from the observed result to investigate possible causes.
When a plane crashes or bridge collapses the engineers tasked with finding the cause don't just throw up their hands if they can't make it happen again.
Same but I never move my emails to local folders.
But this does seem to be a different issue from the one OP mentioned. Seems to be actually this one: https://connect.mozilla.org/t5/discussions/thunderbird-searc... (with suggested solution)
Apple's Mail app has had a virtually identical bug since Catalina; Michael Tsai's article on the issue currently has 636 comments:
https://mjtsai.com/blog/2019/10/11/mail-data-loss-in-macos-1...
After witnessing the bug myself, migrated to Thunderbird with Maildir enabled[1] for long-term storage; have yet to experience the issue despite a large database (>300,000 emails) and daily IMAP import to local folders.
[1] https://tinyapps.org/blog/202207100700_thunderbird_mbox_to_m...
It really is just bad rep and like the severity of this is pretty bad.
Email is a really critical protocol so even if this is happening to only some people, it should still be fixed asap.
I've been amazed over the years this has never been fixed -- it's very hard not to make jokes about the standard lifestyle of open-source programmers, that they don't consider this a priority (note: that's a joke, I consider myself an open-source programmer. I would hope that's obvious, but someone just bothered to sent me a mean anonymous message)
Perhaps there could be an option to disable stemming completely from the inverted index, which would be probably easier to implement than a post-search filter (which in itself doesn't sound very complicated..).
But of course, it's open source, anyone could contribute :D.
Not only is the UX a horror, its results rely on all sorts of technicalities. I, as a software engineer, can understand that a mail has to be downloaded in entirety locally in order to have it indexed and then show up in the results. And I understand that sub-sub directories aren't really a thing in IMAP, so searching this-dir-and-everything below is hard/impossible and so on.
But mostly the search algorithms are poor. So much so, that I often rely on (rip)grep to find mails. Or in a few occasions wrote a quick bash/python horror to push all my mail into a meilisearch instance and then use this search engine to get the lists and filters that I would expect thunderbird to have.
Yes. It's open source. So "go fix it" is a proper reply. But that doesn't make a complaint about the state of the search feature invalid.
One of my biggest bugbears with Microsoft Outlook has always been that its search function is terrible. If you can't find an email then it may as well not exist, and that's been a real problem on a regular basis during my career - particularly latterly when I was in leadership and necessarily lived in my email and calendar.
It's disappointing that Thunderbird has similar issues with such a fundamental function.
Worse though, in Apple Mail I'll search an email address because I got an email earlier in the week and the first thing it'll show me is an email I got from that person 3 years ago with the correct result a few down. I really need a better email client for my phone...
Imagine you're writing trading software, you have an algo go haywire and it machine guns the whole order book, and then you refuse to put a "max order size" outside of the algo to stop it from happening again because you can't figure out why it happened in the first place.
Try telling a regulator or your boss that was your reasoning.
1. Validate input, expect all external input (both human and machine generated) to be completely bogus.
2. Fail fast and early. If something seems off, crash straight away, and do not expect things to magically repair itself at a later stage.
3. Use pre- and post-conditions where appropriate.
I'm not sure about the exact definitions of defensive programming, but static type checking, and possibly unit testing, might also be part of it.
The answer is that you keep working at it iteratively using a combination of logging, reporting, and defensive programming to systematically narrow down the possible causes. Sometimes you never arrive at a true root cause, but you get close enough that you can mitigate the problem and finally close the ticket out. At the end of the day, the customer/user doesn't care as long as it works.
However, what will really piss them off is telling them your hands are tied until they can reliably reproduce the issue for you. It's important they understand that you are working on it, and typically they will go out of their way to help solve the problem when they feel taken care of.
This happens more often, for example when many services work together in an asynchronous way, and in some very rare situation, unwanted behavior occurs. To fix that, it is often easier to reason through the entire process, and to identify weak spots. It might even be a good idea to switch to a different paradigm to avoid certain bugs altogether.
For this particular bug, I would start by reading a lot, and ensurong that the bug is indeed not easily reproducible (by trying to make it reproducible of course). If that fails, I would continue to think about root causes for the bug, and possible workarounds that would work in theory. Then I would try to estimate the amount of work required, and the risk of breaking other things, and report that to those who like to decide on further actions.
And of course, as I know very little about the inner workings of ThunderBird, I would simply ask ChatGPT o3 or similar for advice. It comes up with a plan that seems reasonable.
Sometimes, you can add some additional steps, logging, change behavior in corner case a bit, either to get more understanding next time it happens or even mitigate it. Sometimes, you have plenty of tools and ways to act. In my experience, that sometimes is basically always if one cares enough.
What developers should do on such a critical and long standing issue is to offer an extension that victims can install to volunteer to track the bug. So they can click a button when things are fine to take a snapshot, and click another one when they encounter it.
I would install that and be part of the solution.
Whilst obviously not lethal, this Thunderbird bug sort of reminds me of the Therac-25 incidents in the 1980s. Very occasionally the machine would give patients massive overdoses of radiation. This bug wasn't easy to reproduce (thankfully) and turned out to be due to a race condition.
But of course, you can't find a problem if you don't investigate, and if it's a serious problem that's been documented then, as engineers, we can't just hide behind non-reproducibility as if it's some sort of magic shield. We have a responsibility to investigate and isolate the problem ourselves. If we don't do that we are effectively washing our hands of our own creations.
I've encountered several impossible to reproduced bugs in the past. And what I (or my team) would then do, is re-architecture (refactor) some pieces of software so that we could reproduce it. Like e.g. better logging, specialized layers/adapters/services, simpler logic, and -above all- better testability.
I'll keep using TB. I'll also make sure to look both ways when crossing streets and won't assume that cars are going to stop for red lights because my chance of getting hit crossing a street is more likely than getting hit by this bug.