stateful / vscode-marquee

💡 The missing VS Code homescreen that helps you to stay organized with minimal context switches
https://marquee.stateful.com/
MIT License
101 stars 14 forks source link

[🐛 Bug]: Support 'hong kong SAR' weather #229

Open admc opened 1 year ago

admc commented 1 year ago

VS Code Environment

Version: 1.73.1 Commit: 6261075646f055b99068d3688932416f2346dd3b Date: 2022-11-09T02:08:38.961Z (1 day ago) Electron: 19.0.17 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Darwin x64 22.1.0 Sandboxed: No

Marquee Version

v3.2.11

Workspace Type

Local Workspace

What happened?

image

What is your expected behavior?

That the location is found and weather is shown.

Relevant Log Output

No response

Code of Conduct

Is there an existing issue for this?

admc commented 1 year ago
image

Also a problem for places like, Singapore, wonder if we should show an auto completable list for folks to pick from.

Also the error message could be improved.

christian-bromann commented 1 year ago

This has to do with our internal API not being able to resolve Hong Kong as city, e.g.:

$ curl https://api.marquee.activecove.com/lookupGoogleLocation\?city=Hong%20Kong
{"error":"location not found"

Even though the weather service actually is able to get the weather for the location:

curl https://maps.googleapis.com/maps/api/geocode/json\?key=<REDACTED>\&address=Hong%20Kong
{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "Hong Kong",
               "short_name" : "HK",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "Hong Kong",
         "geometry" : {
            "bounds" : {
               "northeast" : {
                  "lat" : 22.5619469,
                  "lng" : 114.4294999
               },
               "southwest" : {
                  "lat" : 22.1435,
                  "lng" : 113.8259001
               }
            },
            "location" : {
               "lat" : 22.3193039,
               "lng" : 114.1693611
            },
            "location_type" : "APPROXIMATE",
            "viewport" : {
               "northeast" : {
                  "lat" : 22.5619469,
                  "lng" : 114.4294999
               },
               "southwest" : {
                  "lat" : 22.1435,
                  "lng" : 113.8259001
               }
            }
         },
         "place_id" : "ChIJD5gyo-3iAzQRfMnq27qzivA",
         "types" : [ "country", "political" ]
      }
   ],
   "status" : "OK"
}

My hunch is that the response is malformed and/or we are doing the request wrong.