Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to enable or disable reader from admin #155

Open
libreliodev opened this issue Nov 16, 2014 · 34 comments
Open

Make it possible to enable or disable reader from admin #155

libreliodev opened this issue Nov 16, 2014 · 34 comments

Comments

@libreliodev
Copy link
Owner

In the preview page, it should be possible to Deactivate the reader, using an "Activate/Deactivate" button.
The setting should be saved in setup_.plist.

@libreliodev
Copy link
Owner Author

@serverfire The button is there, but it does not seem to have any effect?

AlirezaAlgo added a commit that referenced this issue Nov 23, 2014
@AlirezaAlgo
Copy link
Collaborator

@libreliodev Fixed.

@libreliodev
Copy link
Owner Author

@serverfire Still not working for me. Is bower installneeded?

@AlirezaAlgo
Copy link
Collaborator

@libreliodev No

Can you tell me what happens?
Screenshot would be nice.

@AlirezaAlgo
Copy link
Collaborator

@libreliodev
In which app you're testing it?

@libreliodev
Copy link
Owner Author

@serverfire

Under Firefox, there is now no way to "activate".

screen shot 2014-11-23 at 23 10 09

Previously, it was the opposite, there was no way to deactivate.

@AlirezaAlgo
Copy link
Collaborator

@libreliodev Thanks for your comment.
Apparently browser caches the file and when frame reloads it doesn't have the new file.
I have to check the process in more details. It may take time.

@AlirezaAlgo
Copy link
Collaborator

I can't find a good solution for this issue right now.
The problem is setup.plist won't update after changing Active bool. Browser pretends nothing is changed. But I've checked even Last-Modified header is updated.

A way to fix it is to ignore cache at all.
Sorry.
It's a strange behavior.

@libreliodev
Copy link
Owner Author

@serverfire I will think about it and maybe come up with ideas. However, I am not sure I understand the issue. We use a lot of plists in this project, that need updating from time to time, and we had not met this issue so far. Why do you think we meet this issue now? Is this because we are using a bool? Or is there any other difference that could explain it?

@AlirezaAlgo
Copy link
Collaborator

Why do you think we meet this issue now?

Hard to tell. Here what i think.
Something is restricting the app to get the new data.

  1. It might be cache header that cause browser to not request.
  2. some distinct behavior is involved with using frame(reloading it). But it hardly would be the case. because in multiple browsers it is like that.

Strange behavior:
After refreshing fullscreen preview mode it will update the page and after that. It will work.

Is this because we are using a bool?

No.

@libreliodev
Copy link
Owner Author

@serverfire I still don't understand why we have this problem, and for instance we don't have it with magazines.plist (or maybe I missed something). Did you make additional tests?

@AlirezaAlgo
Copy link
Collaborator

@libreliodev
I noticed chrome doesn't have this problem at all.

@AlirezaAlgo
Copy link
Collaborator

Also with couple of other tests i found it does nothing to do with iframe tag(framing preview).

The exact issue is.
For some reason Firefox does not make request to setup.plist and returns cached file. It doesn't check to see Last-Modified date of response.
Clearing cache will not fix it.

It might does something to do with PUT request before GET request of setup.plist. I have to dig more.

@libreliodev
Copy link
Owner Author

@serverfire OK, thanks for this update

@AlirezaAlgo
Copy link
Collaborator

@libreliodev Apparently five seconds delay before reloading frame solves the issue.

@AlirezaAlgo
Copy link
Collaborator

Nope. It's not true.

AlirezaAlgo added a commit that referenced this issue Dec 4, 2014
@AlirezaAlgo
Copy link
Collaborator

@libreliodev Fixed!!

We should add header cache-control: must-revalidate, max-age=0 for all dynamic files. Such as this one.
Before testing please clear your browser cache. And Test one of the apps in developer account.
For other setup.plist files this issue may come. By editing it once. It will be fixed. (Don't forget to clear browser cache)

@libreliodev
Copy link
Owner Author

@serverfire Sorry, it does not completely work.

Clearing the cache makes it possible to activate or deactivate the preview. But then, when going to settings/general, it's not longer possible to change settings.

Reciprocally, clearing the cache makes it possible to change settings. But then, it's no longer possible to activate/deactivate the preview. Any idea why?

@AlirezaAlgo
Copy link
Collaborator

@libreliodev I think this is because you wasn't using latest changes.
Will you clear browser cache and test it via this url?
http://serverfire.net/project/hossien/libreliodevjs/dist/admin/

@libreliodev
Copy link
Owner Author

@serverfire For some reason, I cannot access to the setup page using your server.

Is there a simple way to test that the latest changes are used when testing?

screenshot 2014-12-05 09 30 48

@AlirezaAlgo
Copy link
Collaborator

@libreliodev
Copy link
Owner Author

@serverfire I confirm that I am suing the latest version. However, I can't reproduce the exact behavior I reported yesterday. Now, what happens is simple:

  • after clearing the cache, I can activate/deactivate reader
    • however, I load another page from the admin console, and then get back to the preview page, I need to clear the cache again.

@AlirezaAlgo
Copy link
Collaborator

@libreliodev I tried it. But it doesn't exist for me.
Can you give me the link? so we use the same source.

@libreliodev
Copy link
Owner Author

@serverfire You can test again on https://librelio-admin.s3.amazonaws.com/preview.html . I had the same problem again from there, both on the preview and the setup page.

Apparently five seconds delay before reloading frame solves the issue.

This probably depends on connection speed and various factors.

@AlirezaAlgo
Copy link
Collaborator

@libreliodev First of all there's another problem we should fix.
In firefox is not allowed to use https: port and have iframe in http.
http://stackoverflow.com/questions/18251128/why-am-i-suddenly-getting-a-blocked-loading-mixed-active-content-issue-in-fire

Can you add https for reader? https://reader.librelio.com/

@AlirezaAlgo
Copy link
Collaborator

If not try with http.

@AlirezaAlgo
Copy link
Collaborator

@libreliodev This issue requires your attention.

First of all there's another problem we should fix.
In firefox is not allowed to use https: port and have iframe in http.
http://stackoverflow.com/questions/18251128/why-am-i-suddenly-getting-a-blocked-loading-mixed-active-content-issue-in-fire

Can you add https for reader? https://reader.librelio.com/

@libreliodev
Copy link
Owner Author

@serverfire

Can you add https for reader? https://reader.librelio.com/

Done

@AlirezaAlgo
Copy link
Collaborator

@libreliodev Now It's working for me. This url.
https://librelio-admin.s3.amazonaws.com/preview.html

@libreliodev
Copy link
Owner Author

@serverfire Thanks! I get the following error under Safari when trying to disable. Do you also have the same issue?
screenshot 2015-02-16 16 49 29

@AlirezaAlgo
Copy link
Collaborator

@libreliodev Yes

@AlirezaAlgo
Copy link
Collaborator

@libreliodev We can turn off frame when app is deactivated. Then this error disappears.

@libreliodev
Copy link
Owner Author

OK, let’s do this.

Emmanuel Prat, CEO
Web: www.librelio.com http://www.librelio.com/
Linkedin: www.linkedin.com/in/eprat http://www.linkedin.com/in/eprat
Twitter: twitter.com/eprat http://twitter.com/eprat
Tel: +33 9 71 42 79 39

On 16 Feb 2015, at 16:56, Serverfire [email protected] wrote:

@libreliodev https://github.com/libreliodev We can turn off frame when app is deactivated. Then this error disappears.


Reply to this email directly or view it on GitHub #155 (comment).

@AlirezaAlgo
Copy link
Collaborator

@libreliodev Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants