Momiji blog
Open the app

Changelog: Reviewing Offline, and Reviews That Don't Wait

What changed in Momiji since the last post

The last post was yesterday, so this one is short, but it’s about something I’ve wanted for a long time: reviewing anywhere. On a train, on a plane, in a basement café with no signal. Your reviews shouldn’t stop because your connection did. While I was at it, I made reviews faster for everyone, especially if you live far away from the server.

Highlights

Reviews don’t wait anymore

Momiji runs on one server. Before, every card waited on three trips to it in a row: get the next card, get its dictionary details, then save your answer. If you’re close to the server you barely noticed, but from the other side of the world every card had a pause before it showed.

Now Momiji loads a batch of your due cards at once and fetches the details for the next few ahead of time. When you answer, the next card is already there. In my testing it shows up in about 15 milliseconds. Your answers are saved in the background in the order you gave them, and if one fails because the connection dropped, it’s tried again until it goes through.

If you close the tab or put your phone away mid-review, any answers that haven’t been saved yet are sent right away, so you don’t lose them. This works for words, kanji, kana, grammar and sentences.

Reviewing without a connection

The first time you open a review page, Momiji asks whether to keep your reviews ready offline on that device.

The Words review page with a prompt above the card asking whether to keep reviews ready offline, with Keep them ready and Not now buttons
Asked once per device. Say yes and Momiji keeps every deck downloaded for you.

If you say yes, Momiji downloads the cards you have due in the next week for every deck, plus a week of new grammar points and sentences, and keeps them up to date. It refreshes them every so often while the app is open, and whenever something changes, like adding words on another device. I made it automatic because nobody knows ahead of time when they’ll lose signal. If it only worked when you remembered to press a download button, it would never be there when you need it.

Then, with no connection, you review like normal. Momiji schedules each card on your device with the same FSRS algorithm the server uses. I ported it over and checked it against the server’s version on 480 answers, and every one came out the same, so the intervals on the buttons are the ones you’d get online. The panel above the card shows how many answers are waiting to sync.

Reviewing 学校 with no connection. The sidebar says Offline, Downloaded reviews still work, and the panel says 3 answers to sync
Reviewing offline. The answers wait on the device and sync on their own when the connection comes back.

When you’re back online, your answers sync in the background. The server counts each one at the time you actually gave it, so your streak, your stats and your progress page all come out the same as if you’d been online the whole time. You can even open Momiji with no connection at all, and it lets you in to review what you’ve downloaded.

If you’d rather not keep reviews on a device, for example one other people use, you can turn it off under Settings → Offline. Logging out also clears everything downloaded, after syncing what it can.

The rest of the app while you’re offline

Some things really do need a connection: the dictionary, stats, anime, adding new words. Before, those pages just showed errors like “Failed to fetch” when you were offline, and some showed made-up zeros like a 0-day streak. Now they say you’re offline and point you to the decks you can review on that device. The streak card in the sidebar changes to Offline · Downloaded reviews still work. Once you’re back online, each page loads by itself.

The home page with no connection: You're offline, with buttons for the Grammar, Kana and Words decks downloaded on this device
The home page with no connection. It links to the decks you can review on this device.

Reviewing on two devices

Say you review 学校 on your phone on the train with no signal, and then review it again on your laptop before your phone has synced. Now there are two answers for the same card, and the server got them in the wrong order.

Most of the time Momiji can just merge them. It replays the card’s review history with your offline answer put back where it belongs in time, so both reviews count, in the order you actually did them. You won’t even notice it happened.

Sometimes the history doesn’t match up, for example on a card whose progress was imported. Then Momiji doesn’t guess. It shows you both answers and lets you choose: keep the other device’s, or count yours too.

The Answers that clashed dialog showing 学校 answered Hard here and Good on another device, with buttons Keep the other device's and Count mine too
When two answers can't be merged, you choose which ones count.

Installing Momiji

You can now install Momiji. On a phone, use Add to Home Screen. On a computer, use the install button in your browser’s address bar or menu. It opens in its own window without the browser around it. If you open it that way, keeping your reviews ready offline is turned on without asking, since that’s most of the reason to install it.

Installing also helps your downloads stick around. Browsers can clear a website’s saved data when space runs low, and Safari does it after about a week of not visiting a site. Momiji asks the browser to keep its data, and if the browser says no, Settings tells you and suggests installing.

The Offline section of Settings with Keep my reviews ready offline on this device checked, and a note suggesting installing Momiji
Settings → Offline shows what's ready and whether your browser might clear it.

Smaller things

What’s next

Offline review is new, and losing someone’s answers would be the worst thing it could do, so like Sentences for you, I’m turning it on for a few people at a time first. If you review on the go, or you’re far away from the server and want to try it, ask on the Discord. Once I’ve seen it hold up, it’ll be on for everyone.