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

Firefox Push Issue #2

Closed
robertuniqid opened this issue Feb 12, 2016 · 14 comments
Closed

Firefox Push Issue #2

robertuniqid opened this issue Feb 12, 2016 · 14 comments

Comments

@robertuniqid
Copy link

Hey, I'm not sure if you've encountered this or aware of this issue.

But it seems like I need to send 2 Notifications in order for Firefox to work properly, I am not sure why this happening or how to solve it.

Chrome seems to work out of the box.

Now, an really funny think I've noticed.

If both Chrome and Firefox are open, the notification in Firefox comes just normal.

What could be the cause of this ? Is it something you've noticed or maybe something goes wrong.

I've tested this theory like 7 times

@marco-c
Copy link
Member

marco-c commented Feb 12, 2016

@rusuandreirobert are you by any chance using something like BrowserSync?

@Minishlink
Copy link
Member

I never have encountered this issue, sorry.

It doesn't look like this issue comes from the server side, but if it's the case, one way to be sure is to look if the correct requests are sent with a tool like Fiddler.

EDIT: you will need to set the Client proxy to Fiddler like this:

$webPush->getBrowser()->getClient()->setProxy('http://127.0.0.1:8888');

@robertuniqid
Copy link
Author

@Minishlink Seems like Marco is right, thanks tough I've noted this.

@marco-c I didn't expect that to be a problem honestly, is there any work-around to allow it to work ?
I think I've read somewhere it doesn't work with Browser Sync on, but I didn't even think to check if I ever enabled it.

        _register : function() {
          var objectInstance = this;

          navigator.serviceWorker.register(this.serviceWorker, {
            'scope' : "{{ "./"  }}"
          }).then(function(serviceWorkerRegistration) {
            var subscription = serviceWorkerRegistration.pushManager.getSubscription();

            serviceWorkerRegistration.pushManager.subscribe({userVisibleOnly: true}).then(
              function(pushSubscription) {
                objectInstance.registerSubscription(pushSubscription.endpoint);
              }
            );
          });
        },

@marco-c
Copy link
Member

marco-c commented Feb 12, 2016

I'm not really familiar with browserSync, I just recall that it was causing problems.
Are you running both Firefox and Chrome at the same time? Can you try what happens if you run only one browser?

I would file an issue on the browser-sync repo: https://github.com/BrowserSync/browser-sync/issues/new, since this behavior is certainly confusing.

@robertuniqid
Copy link
Author

I'm using the internal one from Firefox.

If both browsers are open, it works perfectly.

@marco-c
Copy link
Member

marco-c commented Feb 12, 2016

@rusuandreirobert yeah, I don't know what's going on, but it's definitely unrelated to this library, it's a browser-sync issue.

@robertuniqid
Copy link
Author

Okay, thanks tough, I hope it will eventually get fixed, the latest Firefox update didn't cover it.

@marco-c
Copy link
Member

marco-c commented Feb 12, 2016

@rusuandreirobert it's a browser-sync issue, not a Firefox issue.

@marco-c
Copy link
Member

marco-c commented Feb 12, 2016

@rusuandreirobert to clarify, are you using browser-sync (https://github.com/BrowserSync/browser-sync) or are you using Firefox Sync (the feature to synchronize data between your Firefox devices/installations). They're two completely different things.
I'm confused because you said the internal one from Firefox.

@robertuniqid
Copy link
Author

The one from Firefox

@marco-c
Copy link
Member

marco-c commented Feb 12, 2016

@rusuandreirobert OK, then it's a completely different thing and shouldn't cause any problems with Web Push.
Can you share some minimal source code that presents the problem? Are you seeing the problem if Firefox Sync is enabled and not seeing the problem if it is disabled (in the same profile, or have you created a new Firefox profile)?

@robertuniqid
Copy link
Author

After unsyincing my account and logging back in it works as expected, maybe they'll patch this soon, not sure. But it seems to work as expected, BrowserSync Library shouldn't be able to sync Service Workers anyway, so I never expected it to work using that, but using the Firefox built-in functionality it works if you logout and login under the new version.

@marco-c
Copy link
Member

marco-c commented Feb 12, 2016

@rusuandreirobert I've never experienced this bug in Firefox. I mentioned BrowserSync because I vaguely recalled a friend had problems while using it, but BrowserSync and Firefox Sync are two completely different things, they aren't two different implementations of the same thing.

Anyway, are you able to reproduce the problem consistently? Or has it just disappeared? If you're able to reproduce it consistently, it would be great if you could help pinpointing the issue.

@robertuniqid
Copy link
Author

I'm still testing it intensivelly, as this system would need to serve around 6000 - 7000 customers of an store, after I know the system is stable and sorted out I'll probably write an article on how I achieved this, mentioning all the set backs

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

No branches or pull requests

3 participants