Dark theme is not available after inactivated [resolved]

I had purchased the dark theme a few days ago, use it for a while just to try it out. Then I set the editor theme back to light theme. Last night, I wanted to use the dark theme again (for another bed time coding). But I couldn’t activate it. Codea said it can’t connect to server, or something like that, I forgot the exact wording. I thought the theme is stored locally once we purchase it, no? My wifi router seemed to have a problem last night –for unknown reasons– so my iPad couldn’t access the internet. I was too lazy to get off my bed and fix the router. Instead, I opened and read a book from my iBooks library, and forgot about this Codea problem.

This morning, I got my wifi router fixed and my iPad is able to connect to the internet again. Then I remembered the Codea problem last night, so I opened it and tried to activate the dark theme. There’s no error message, but the dark theme wasn’t loaded either. It just kept loading, as if it downloaded something huge from the net. I killed Codea from the taskbar, and restarted it again. Unfortunately, it still said “loading…” below the dark theme thumbnail in the setting panel. Been tried anything e.g. repurchase it, back and forth to light theme, restarted it again a few times, etc. but I didn’t get my luck. It just kept “loading…” infinitely. So, I gave up. :frowning:

Then now I report it here from the same iPad with the same internet connection. Clearly, I got no problem with my internet connection. Could someone (@simeon?) help me to activate again the dark theme? I thank you in advance for any kind of help.

You might try deleting Codea from iPad, then downloading it again. I have had to do that a few times on other apps to get them working right.

Eww… It’s so… Windows! :smiley: I used to do that (delete-restart-reinstall) when I jailbroke my iPad, when it was still on iOS v.4.0.x or something. I thought it’s due the “jailbreak effect”. But since I upgraded to iOS v.4.3, I haven’t jailbroken my iPad as I have no reason nor need to do it. And I never use the delete-restart-reinstall method again ever since. I think it’s time to try it again. Ah, to bad my kid is now having my iPad. I will try it later then. Thank you. :slight_smile:

@bee that’s very strange. So it says “Loading…” under the dark theme? I will look into why that is the case.

Did you try the “Restore Purchases” button at the bottom of the side bar? It sounds like Codea is unable to connect to Apple’s servers. Though it shouldn’t need to if the product has been unlocked in the past. That is extremely odd.

Try this as well: go to Settings->Store and sign yourself out of the store. Then open Codea and attempt the Restore Purchases, it should have you sign in again and re-unlock your purchases.

Edit: Codea requires iOS 5 — you must have iOS 5 installed, not 4.3, surely?

@simeon: Yes, it said “Loading…” under the dark theme thumbnail in the setting panel. Yes, I did try “Restore Purchases” button, but it did nothing. No, Codea SHOULD be able to connect to Apple’s servers this morning because I opened App Store app just fine. And yes, I got iOS 5 and Codea v1.3.1 installed in my iPad. I’m definitely sure about it. :slight_smile:

I mentioned iOS v.4.3 just to tell my experience while I was a jailbreak user. Since v.4.3.3, I’m not and don’t have any plan to jailbreak again.

BTW, I’m now away from my iPad. So, I can’t do anything at the moment. It’s okay. I’ll try it again once I got it on my hand. :wink:

That’s really strange. It shouldn’t even need to be online to enable the dark theme (like you mentioned, it gets stored on the device that it is unlocked, and checks that first when selecting it). I’ll have to look into it later tonight.

I think I know what causes this problem, @simeon. I disable in-app purchase to prevent my kids purchase things from their toy apps. After I enable the in-app purchase setting, I could enable the dark theme instantly without any problems. As soon as I disable it, the above problem occurs again. And this is the odd thing, now Codea correctly shows error window about the disabled in-app purchase setting and demand it to be enabled. Last night, Codea didn’t show any error message/window. Maybe it failed to detect that the internet is down so it infinitely tried to contact Apple server. So, I assume that Codea needs to contact Apple’s server to get the state of its in-app purchase, albeit the thing being purchased has been already stored locally. What do you think?

Thanks @bee, that gives me a good starting point for handling this situation more gracefully in the future.

FYI, I got many other apps that have things purchased via in-app but AFAIK they always work fine and could correctly detect the in-app purchase state though my iPad is completely disconnected from the net. Perhaps they save the in-app state somewhere locally and use that info if they couldn’t contact Apple’s server.

It’s very odd, I’m looking at this issue at the moment and from what I can see it should work with IAP disabled and no internet connection — as long as the product has been previously purchased. I’ll try to do some further testing, there is obviously an issue somewhere.

Could you reproduce the problem?

It’s not possible for me to test with the development version (connects to a sandboxed IAP server). I’m downloading the App Store version to see if I can recreate it.

I can re-create the issue with the App Store version — this will help a lot.

Ah, glad to hear you’re able to reproduce the problem. Hope this will be fixed. Thank you. :slight_smile:

Found the bug. It should be fixed in 1.3.2.

Should I create a bug report for this? Or this thread is enough? :slight_smile:

The thread is enough. Thanks for your help, I’ve fixed it now — a stupid oversight on our part, like most bugs :).

Alright then. You’re welcome. :slight_smile:

I think all of us budding Codea programmers understand how hard it is to avoid bugs! :slight_smile: TLL has been super responsive in fixing them when they arise, and the users have been great at spotting them.

Yes, as any programmers know, the most important thing isn’t about creating a bugless program (since there’s none unless you create a hello-world-like program), but it’s about creating a program that bugs can be easily tracked and fixed as soon as possible. :slight_smile: