stf icon indicating copy to clipboard operation
stf copied to clipboard

Small issue with model name in stf/database

Open viktors89 opened this issue 9 years ago • 7 comments

What is the issue or idea you have?

I changed in rethinkdb the model of all devices in the database so that the name of the phone displayed is clear (some devices had weird model names), but the moment I disconnected a device and connected it again, this value resets to the previous one that confuses people.

Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row.

Happens in all devices

Please provide the steps to reproduce the issue.

  1. Connect a phone to OpenSTF
  2. Connect to the rethinkdb admin
  3. Make a query to change the model name of the device connected in step 1
  4. Refresh and check that the model name changed succesfully
  5. Disconnect the device
  6. Connect the device

What is the expected behavior?

Model name changed in step 3 doesn't change when disconnecting and connecting

viktors89 avatar Apr 05 '17 10:04 viktors89

That is expected behavior right now. It upserts the information on every launch. On Wed, Apr 5, 2017 at 19:14 viktors89 [email protected] wrote:

What is the issue or idea you have?

I changed in rethinkdb the model of all devices in the database so that the name of the phone displayed is clear (some devices had weird model names), but the moment I disconnected a device and connected it again, this value resets to the previous one that confuses people.

Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row.

Happens in all devices

Please provide the steps to reproduce the issue.

  1. Connect a phone to OpenSTF
  2. Connect to the rethinkdb admin
  3. Make a query to change the model name of the device connected in step 1
  4. Refresh and check that the model name changed succesfully
  5. Disconnect the device
  6. Connect the device

What is the expected behavior?

Model name changed in step 3 doesn't change when disconnecting and connecting

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openstf/stf/issues/567, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_ZMM2DndqKelJYpSxbYD4g9WyGUdks5rs2l0gaJpZM4M0CBd .

sorccu avatar Apr 05 '17 10:04 sorccu

Thanks for the quick reply!

Is there anyway I can change these values so that they stay permanently in the db? (Or any workaround that would just let users see quickly which device is which by their known name without knowledge of device model)

viktors89 avatar Apr 05 '17 10:04 viktors89

Make your own stf-device-db and replace the built-in one :) Might have to fork stf to change package.json though.

For models that are in the "database", it does show the name. Unfortunately it has not been updated for quite a while and never contained all possible devices anyway.

On Wed, Apr 5, 2017 at 19:48 viktors89 [email protected] wrote:

Thanks for the quick reply!

Is there anyway I can change these values so that they stay permanently in the db? (Or any workaround that would just let users see quickly which device is which without knowledge of device model)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/openstf/stf/issues/567#issuecomment-291824408, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_cr-2KhkbyV68KcWDaVyu2LLykJKks5rs3GRgaJpZM4M0CBd .

sorccu avatar Apr 05 '17 10:04 sorccu

If you don't have any devices with a known model, you can try running 'stf generate-fake-device' to load some random data into the device list to see how it looks.

On Wed, Apr 5, 2017 at 19:57 Simo Kinnunen [email protected] wrote:

Make your own stf-device-db and replace the built-in one :) Might have to fork stf to change package.json though.

For models that are in the "database", it does show the name. Unfortunately it has not been updated for quite a while and never contained all possible devices anyway.

On Wed, Apr 5, 2017 at 19:48 viktors89 [email protected] wrote:

Thanks for the quick reply!

Is there anyway I can change these values so that they stay permanently in the db? (Or any workaround that would just let users see quickly which device is which without knowledge of device model)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/openstf/stf/issues/567#issuecomment-291824408, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_cr-2KhkbyV68KcWDaVyu2LLykJKks5rs3GRgaJpZM4M0CBd .

sorccu avatar Apr 05 '17 10:04 sorccu

My workaround is: create a script to update model name in rethinkdb, and add it to cronjob to run every 5 minutes :)

xiaweixing avatar May 03 '17 02:05 xiaweixing

@xiaweixing Mind sharing that script?

Otiel avatar Aug 07 '18 12:08 Otiel

@Otiel , sorry, I haven't worked on this for quite long time, so cannot remember the exact script. But it's all in rethinkdb, you can go to your own rethinkdb admin page, and browser the tables, you should be able to find a table containing all devices information. Then you can use rethinkdb SQL to update the model name. If it works (it should), you can create a script (e.g. python) to do this and run it as a cronjob regularly. Hope it helps!

xiaweixing avatar Aug 19 '18 23:08 xiaweixing