Skip to content

Offline first, but is it really always offline?

Tziyun B'Rega works without an internet connection, but a few features need one. Telling the two cases apart turned out to be harder than we expected.

6 min read

A laptop on a desk by a window at golden hour, with a network cable lying loose and unplugged beside it.

6 min read

On 30 August 2026, our Windows test machine told us it was online. It was genuinely cut off from the internet. Its virtual network card was up, and the browser’s own “online” flag (a yes-or-no value it keeps) believed the card.

That is the whole problem in one moment: “connected” and “online” are not the same word. Tziyun B’Rega is built to work with no internet at all. Creating, printing, scanning and grading all happen on the computer itself. A few things do need the internet: importing an exam or a student list with AI, and downloading updates. So the program has a small check in its code, like a gate, that decides whether the internet-only buttons are switched on. It answers one question: is this computer really online right now?

It sounds like a one-line job. It took us several tries.

Key points

  • The program works with no internet at all. A few features, such as importing with AI and downloading updates, need it.
  • The browser’s “online” flag says there is some network connection, not that it reaches the internet.
  • Three checks, in order: the network card, a connection to the outside by numeric address, and a real answer from a well-known site. A login page does not count.
  • An unanswered check can never unlock a feature that needs the internet.

Try one (not one of the checks): ask the browser

The screen of the program is a web page, and every browser has a built-in “am I online” flag. Our first version trusted it.

The flag does not mean what you would hope. It says whether the computer has a network connection of some kind, not whether that connection reaches the internet. A computer on a school router with no outside line says “online”. So does a computer behind a filter that blocks most of the internet, a situation that is common among the people we build this for.

The test machine showed it to us. The fix was to stop trusting the browser flag anywhere. The Go (opens in a new tab) side of the program is now the only authority, and the screen is told the answer. Until the first answer arrives, the program assumes “offline”.

Try two (check one): is the cable plugged in?

The next layer down is the hardware: does the computer have a network card that is switched on? This is cheap to check and needs no network traffic, so it is the first step of our check. But it only proves the plug is in the wall. It cannot tell you about the road beyond.

Try three (check two): can we reach the outside?

So the second step goes one layer up. The program tries to open a connection to a well-known public name service, the kind of service that turns web names into addresses. It uses the numeric address, so the test does not need the very lookup it is testing. If this works, the route to the outside world is open.

This is our “real network test”. The idea we kept was to test the road, not the car.

Try four (check three): does a real website answer, in the real way?

Even that is not enough. Hotel and airport Wi-Fi often let a connection open and then show a login page instead of the website you asked for. To the program, that looks like the internet is there, and it is not.

So the third step asks for a small page from a few well-known “are you online” addresses, the kind phones use for the same job. It asks them in parallel, and one genuine answer is enough, so one blocked address does not make the school look offline. The program accepts only the exact reply a real internet gives: a particular status, and for one of them a particular line of text. A login page does not match, so a login page does not count as being online. The three layers were already in the code from May 2026. This parallel version, which accepts only the exact reply, landed on 30 September 2026.

The code records which layer failed. When someone says “it says offline”, we can see whether the card was down, the route was closed or a login page was in the way.

The three checks, in order
  1. The plug Is a network card switched on? Cheap to check, and it needs no network traffic. It only proves the plug is in the wall.
  2. The road Can we open a connection to a well-known public name service, by its numeric address? If so, the route to the outside world is open.
  3. The answer Does a real website answer in the real way? Only the exact reply a real internet gives counts, so a login page does not.

A detail about speed

A comment in the code notes that on a freshly started test machine, the very first lookup once took 11 seconds, and 10 milliseconds afterwards. So each round of checks has a time limit, and the results are remembered for a short while, so that many parts of the program asking at once do not each start their own test. While online, the program checks every 20 seconds. While offline it checks more often, every 5 seconds, so it notices when the connection comes back.

What the answer is used for

The gate is deliberately narrow. It does not switch the product into some “online mode”. It only decides whether a feature that needs the internet should be offered:

  • Importing an exam or a student list with AI needs the internet, so those buttons are off when the program is offline.
  • Cloud features check their own destination as well, because general internet is necessary but not sufficient.

One refinement came on 18 October 2026. Our automated tests use a stand-in that replays a saved answer instead of calling a real AI service, and it needs no internet. The gate now asks whether the feature in use really needs the internet, and if the answer is missing it assumes yes. An unanswered check can never unlock a feature that needs the internet.

What we learned

Offline first is a promise to the person using the program: it will not stop working because the internet is missing. Being honest about when the internet is there turned out to be a separate, harder piece of work. Asking the browser was a guess. Looking at the cable was half a fact. Only asking the outside world, and accepting only a real answer, was reliable enough to build on.

Read next

"Why can't you just scan it?" How Tziyun B'Rega beganIt started with one email asking a simple question. The studio's account of the first search, a lottery-ticket comparison, a childhood memory of bubbles, and why we built our own reader.How we chose the tools: Tauri, Electron, then Wails and GoWe started with Rust and Tauri, went back to the tools we knew, and ended up with Go and Wails, which we never planned. The lesson: pick tools you can deliver with.

Got something to build? Let's talk.

No sales pitch. Tell us what your business needs and we'll tell you straight how we'd tackle it, or whether you need it at all.

9 stories about Tziyun B'Rega

All 9 stories

"Why can't you just scan it?" How Tziyun B'Rega beganIt started with one email asking a simple question. The studio's account of the first search, a lottery-ticket comparison, a childhood memory of bubbles, and why we built our own reader.How we chose the tools: Tauri, Electron, then Wails and GoWe started with Rust and Tauri, went back to the tools we knew, and ended up with Go and Wails, which we never planned. The lesson: pick tools you can deliver with.Why we left Electron: the exam that moved on the pageTziyun B'Rega printed exams through a hidden Chrome window, and later pages drifted. We tried LaTeX twice, then found Folio, Go and Wails. The project history shows the path.Printing without the print dialog: learning from how Chrome does itThe first idea was to hand printing to the operating system and let people sort out the options. That was a mistake. Here is how we cut the choices down to three, and how reading Chromium's source helped.Finding the scanner, and taking over its settingsA teacher should press one button and get a scan. Behind that button are a search for the scanner, a list of settings nobody should have to touch, and a Windows firewall surprise.Building Windows software from a Mac: a borrowed computer, a virtual machine and a photo of an errorSchools run Windows. We work on a Mac and Ubuntu. This is how Tziyun B'Rega learned to build and test for Windows, and the photo that taught us the most.A mouse pointer that looked wrong on WindowsThe same program can look different on every operating system. One day the mouse pointer changed on Windows, so we chose our own pointer and learned to test the small things.Watching a school computer from far away: what the logs taught us about small computersTziyun B'Rega sends its logs home so we can see it work where we cannot visit. A small computer in a remote town showed us that a computer's size, and in the end its processor, decides how well the program runs.Offline first, but is it really always offline?You are reading this story. Tziyun B'Rega works without an internet connection, but a few features need one. Telling the two cases apart turned out to be harder than we expected.
Accessibility menu

Keyboard shortcuts

Open accessibility menuAlt+A
Accessibility statement

These settings are saved on your device only and are used to adjust the display. They do not change the site content and send no information to any server.