noi-techpark / it.bz.beacon.api

This repository contains the sourcecode of the administration web-app that allows to manage the beacon network installed withing the Beacon Suedtirol project.
Other
1 stars 3 forks source link

The users of the admin app need to modify the GPS coordinates of the POI descriptioned by the Beacon. #59

Closed sseppi closed 3 years ago

sseppi commented 4 years ago

Deadline: Friday 11th of December

Actually the import of the data from the beacon spreadsheet in the beacon admin App does not work and the GPS coordinates doesn't update.

We have checked the logs with Alex and we get this error message:

    2020-08-14 02:00:32.012  INFO 26499 --- [   scheduling-1] i.b.b.a.s.i.InfoReplicationTask          : Starting sheet import...
    2020-08-14 02:00:32.017 ERROR 26499 --- [   scheduling-1] i.b.b.a.s.i.InfoReplicationTask          : An unexcpected error occurred: null

I think this is related to wrong format of GPS coordinates in some cells of the spreadsheet but is difficult to identify. It would be really useful to have more information in the logs.

bertolla commented 4 years ago

I analyzed the code and found out some worrying things:

  1. No google access credentials where ever generated to access spreadsheet. They are not present in the live code, nor was it ever applied to any pipeline.
  2. The synch code is not working at all when fixing the credential problem, since it does write operations on a view which is combined by different tables.
    SELECT info.id,
    info.created_at,
    info.updated_at,
    info.address,
    info.cap,
    info.latitude,
    info.location,
    info.longitude,
    info.floor,
    info.instance_id,
    info.major,
    info.minor,
    info.name,
    info.namespace,
    info.uuid,
    info.website,
    beacon_data.battery_level,
    beacon_data.trusted_updated_at,
    ( SELECT count(*)::integer AS count
           FROM issue
          WHERE issue.beacon_data_id::text = beacon_data.id::text AND issue.solution_id IS NULL) AS open_issue_count
    FROM info
     LEFT JOIN beacon_data ON info.id::text = beacon_data.id::text;

    Which means synchronization never worked and never will if we do not rewrite the code (quasi) from scratch. The only other valid explanation could be that the migration scripts messed with the db and did not consider the code, but I don't know anything about that and think that's quiet improbable. Since I don't know anything anything about the logics here a estimate a full week of work to make synchronization work again(for the first time) properly.

sseppi commented 4 years ago

Thank you Patrick for the check and the explanation!

I think that, since we show have in the Admin App interface also the GPS of the POI in read only mode, I would suggest to allow the users to change it directly in the interface. This could allow also to make checks on the data input in order to avoid this kingd on problem.

If you agree I could add this issue to a list of improvements that I would do with an external.

rcavaliere commented 4 years ago

@sseppi checks with Davide and konverto how to solve this issue through future development activities

davidebz commented 3 years ago

Thomas already send sql statements for updating beacons. For the future the spreadsheet is not used anymore and replaced by editing directly the info data in the admin webapp. Is this issue still open?

Piiit commented 3 years ago

@sseppi Can I close this issue, since we no longer use spreadsheets?