tonesto7 / fordpass-scriptable

FordPass Widget for Scriptable
GNU General Public License v3.0
169 stars 27 forks source link

Error on line 2574:51 TypeError: undefined is not an object #56

Closed gmatrangola closed 2 years ago

gmatrangola commented 2 years ago

I cleared my data using the debug menu. Then, I entered my username, password and vin when I tried to start again and now I get the error "Exception Occured, Error on line 2573:51: TypeError: undefined is not an object (evaluating 'vehicle.batterFillLevel').

I ran the Charles Proxy to see what was going on. Here are some interesting findings...

Check out the unexpedly short response below

{
status: "COMPLETE",
method: "GET",
protocolVersion: "HTTP/1.1",
scheme: "https",
host: "usapi.cv.ford.com",
actualPort: 443,
path: "/api/vehicles/v4/MYVIN/status",
query: null,
tunnel: false,
keptAlive: false,
webSocket: false,
remoteAddress: "usapi.cv.ford.com/40.71.221.102",
clientAddress: "198.1...",
times: {
start: "2022-01-17T22:55:38.765-05:00",
requestBegin: "2022-01-17T22:55:38.775-05:00",
requestComplete: "2022-01-17T22:55:38.777-05:00",
responseBegin: "2022-01-17T22:55:38.837-05:00",
end: "2022-01-17T22:55:38.852-05:00"
},
durations: {
dns: 82,
connect: 27,
ssl: 151
},
totalSize: "1493",
ssl: {
protocol: "TLSv1.2",
cipherSuite: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
},
request: {
sizes: {
body: "0",
headers: 1278
},
mimeType: "application/json",
charset: null,
contentEncoding: null,
header: {
firstLine: "GET /api/vehicles/v4/MYVIN/status HTTP/1.1",
headers: [
{
name: "Host",
value: "usapi.cv.ford.com"
},
{
name: "Content-Type",
value: "application/json"
},
{
name: "Application-Id",
value: "71A3AD0A-CF46-4CCF-B473-FC7FE5BC4592"
},
{
name: "Cookie",
value: "_REDACteD"
},
{
name: "auth-token",
value: "eyJ0e...8Vg0w"
},
{
name: "Accept",
value: "*/*"
},
{
name: "User-Agent",
value: "FordPass/5 CFNetwork/1327.0.4 Darwin/21.2.0"
},
{
name: "Accept-Language",
value: "en-US,en;q=0.9"
},
{
name: "Accept-Encoding",
value: "gzip, deflate, br"
},
{
name: "Connection",
value: "keep-alive"
}
]
}
},
response: {
sizes: {
body: "42",
headers: 173
},
mimeType: "application/json",
charset: "utf-8",
contentEncoding: null,
header: {
firstLine: "HTTP/1.1 200 OK",
headers: [
{
name: "Content-Length",
value: "42"
},
{
name: "Content-Type",
value: "application/json; charset=utf-8"
},
{
name: "ActivityId",
value: "c9131f17-21cb-4772-ac30-41254cd4e69a"
},
{
name: "Date",
value: "Tue, 18 Jan 2022 03:55:38 GMT"
}
]
},
body: {
text: "{"$id":"1","status":401,"version":"1.0.0"}",
charset: "utf-8"
}
}
gmatrangola commented 2 years ago

Update: I realized that I have two ford.com accounts. One is associated with my VIN and one that is not. This bug appears when you log into the widget with a username/password with no VIN. However, the bug is that there is no way to re-run the script to enter another username password or clear the saved data because this error message appears before the menu is displayed.

tonesto7 commented 2 years ago

This has been fixed in tomorrows V2.0 release