google / physical-web

The Physical Web: walk up and use anything
http://physical-web.org
Apache License 2.0
5.99k stars 665 forks source link

Case study: Results of testing, Physical web uncertain behavior w.r.t, location permission, bluetooth and google chrome launch #651

Closed kanodia closed 8 years ago

kanodia commented 8 years ago

Hello

I have been playing with physical web and observed few things. Please have a look at my case study.

I am considering a user who has chrome 49/50 installed with an active data connection and has never seen physical web notification before on his phone (i.e., under privacy settings, physical web is off)

Based on my knowledge about physical web, there are three simple steps _for a user to _get first time physical web permission notification on his phone.

They are:

1| Bluetooth turned on 2| Location turned on 3| Google chrome opened or running in background

(Please, do correct me if I am wrong here)

I any of this is not checked, then physical web will not wake up even if your phone comes in the range of a beacon broadcasting a Https URL.

Now the behavior that I observed is:

# Case 1:

First I switched on bluetooth, then turned on location and then I opened google chrome (in sequence)

Observation: I could easily get first time physical web notification

# Case 2:

First I switched on location then opened google chrome and then turned on bluetooth (in sequence)

Observation: I could easily get first time physical web notification

# Case 3:

First I switched on bluetooth then opened google chrome and then turned on location (in sequence)

Observation: I could not get physical web notification. I tried turning my screen off and then put it to on again. Nothing worked.

Then I closed google chrome and opened it again, I could find physical web notification.

# Case 4:

First I opened google chrome and then turned on location and the turned on bluetooth (in sequence)

Observation: I could not get physical web notification. I tried turning my screen off and then put it to on again. Nothing worked.

Then I closed google chrome and opened it again, I could find physical web notification.

# Case 5:

First I turned on location and then turned on bluetooth (in sequence)

Observation: I could not get physical web notification. I tried turning my screen off and then put it to on again. Nothing worked.

Then I opened google chrome, I could find physical web notification.

_# Case 6: _

( It was a test to detect physical web for the second time when it comes in the range of a new beacon, hence physical web is on state )

Location and bluetooth is on. My google chrome is not opened nor running in the background.

Observation:I could not get physical web notification. I tried turning my screen off and then put it to on again. Nothing worked.

Then I opened google chrome, I could find physical web notification.

# Conclusions:

1| If location permission is turned on after launching chrome, then physical web does not comes. It will only come if we relaunch chrome. Thus to generalise, location has to be turned on before opening chrome to get physical web.

2| If google chrome is not opened, then also physical web will not come. We need to open google chrome to get physical web.

3| Even if physical web is enabled and google chrome has been launched once. If we close it, then it will not scan for new beacons even if bluetooth and location is on.

# Expectations:

For conclusion 1| I think that it is a bug, as the order of enabling bluetooth, location or chrome should not effect scanning of physical web

For conclusion 2| I feel that we already demand a lot of permissions from users already, then physical web scanning should work independently without chrome to be opened or running in background. We can may be achieve this by running a service in background that starts scanning only when bluetooth, location and data connection is on.

For conclusion 3| I think it is a bug. Say even if we require the user to open chrome at least once( hopefully as of now), then even if he closes chrome, he should be able to see physical web if he comes in the range of new beacons. We can't expect the user to keep chrome opened always or manually open it everytime to get physical web.

Thank You

Looking forward for your response! :)

cco3 commented 8 years ago

Thank you for the thorough investigation! Feel free also to file future bugs for the chrome client at crbug.com under the PhysicalWeb component (and you can add me as an owner if you like).

1: Your conclusion is correct, it's not that the ordering matters so much as the only hook we are currently using to subscribe to the service that let's us know about eddystone-urls is on startup.

We've considered also watching for location permission grant, but we also aren't sure if it'd be particularly annoying to get a notification about the physical web right after enabling location for something else.

Watching for a bluetooth state change is slightly trickier, because chrome doesn't have the bluetooth permission pre-M. Also, I'm not sure there'd ever be an appropriate time to ask for bluetooth permission to check the state in M+. Lastly, I'm not sure where a sane place would be in the chromium code base to regularly attempt to resubscribe to the service the feeds us eddystone-urls.

2: We have to open chrome before chrome can do anything. If I understand your proposed solution, there are two insuperable issues: a) You'd have to open chrome before you could start the service b) the idea of chrome running a service constantly to poll these things would be too memory intensive---it's a no-go.

3: Yes, this is a bug with a service we depend on, not with the chrome client itself. It should be fixed soon.