Fix European trip return heuristic for weekend location tracking

Adjust European short trip heuristic from >3 days to >1 day to correctly
detect when user has returned home from European trips. This fixes the
April 29-30, 2023 case where the location incorrectly showed "Sankt Georg, Hamburg"
instead of "Bristol" when the user was free (no events scheduled) after
the foss-north trip ended on April 27.

The previous logic required more than 3 days to pass before assuming
return home from European countries, but for short European trips by
rail/ferry, users typically return within 1-2 days.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Edward Betts 2025-07-16 06:38:37 +02:00
parent 663dc479c2
commit ea4980a5d7
6407 changed files with 1072847 additions and 18 deletions

21
node_modules/@webassemblyjs/helper-buffer/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Sven Sauleau <sven@sauleau.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,65 @@
// this are dev dependencies
var diff = require("jest-diff");
var _require = require("jest-diff/build/constants"),
NO_DIFF_MESSAGE = _require.NO_DIFF_MESSAGE;
var _require2 = require("@webassemblyjs/wasm-parser"),
decode = _require2.decode;
var oldConsoleLog = console.log;
export function compareArrayBuffers(l, r) {
/**
* Decode left
*/
var bufferL = "";
console.log = function () {
for (var _len = arguments.length, texts = new Array(_len), _key = 0; _key < _len; _key++) {
texts[_key] = arguments[_key];
}
return bufferL += texts.join("") + "\n";
};
try {
decode(l, {
dump: true
});
} catch (e) {
console.error(bufferL);
console.error(e);
throw e;
}
/**
* Decode right
*/
var bufferR = "";
console.log = function () {
for (var _len2 = arguments.length, texts = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
texts[_key2] = arguments[_key2];
}
return bufferR += texts.join("") + "\n";
};
try {
decode(r, {
dump: true
});
} catch (e) {
console.error(bufferR);
console.error(e);
throw e;
}
console.log = oldConsoleLog;
var out = diff(bufferL, bufferR);
if (out !== null && out !== NO_DIFF_MESSAGE) {
throw new Error("\n" + out);
}
}

78
node_modules/@webassemblyjs/helper-buffer/esm/index.js generated vendored Normal file
View file

@ -0,0 +1,78 @@
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function concatUint8Arrays() {
for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {
arrays[_key] = arguments[_key];
}
var totalLength = arrays.reduce(function (a, b) {
return a + b.length;
}, 0);
var result = new Uint8Array(totalLength);
var offset = 0;
for (var _i = 0, _arrays = arrays; _i < _arrays.length; _i++) {
var arr = _arrays[_i];
if (arr instanceof Uint8Array === false) {
throw new Error("arr must be of type Uint8Array");
}
result.set(arr, offset);
offset += arr.length;
}
return result;
}
export function overrideBytesInBuffer(buffer, startLoc, endLoc, newBytes) {
var beforeBytes = buffer.slice(0, startLoc);
var afterBytes = buffer.slice(endLoc, buffer.length); // replacement is empty, we can omit it
if (newBytes.length === 0) {
return concatUint8Arrays(beforeBytes, afterBytes);
}
var replacement = Uint8Array.from(newBytes);
return concatUint8Arrays(beforeBytes, replacement, afterBytes);
}
export function makeBuffer() {
for (var _len2 = arguments.length, splitedBytes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
splitedBytes[_key2] = arguments[_key2];
}
// $FlowIgnore
var bytes = [].concat.apply([], splitedBytes);
return new Uint8Array(bytes).buffer;
}
export function fromHexdump(str) {
var lines = str.split("\n"); // remove any leading left whitespace
lines = lines.map(function (line) {
return line.trim();
});
var bytes = lines.reduce(function (acc, line) {
var cols = line.split(" "); // remove the offset, left column
cols.shift();
cols = cols.filter(function (x) {
return x !== "";
});
var bytes = cols.map(function (x) {
return parseInt(x, 16);
});
acc.push.apply(acc, _toConsumableArray(bytes));
return acc;
}, []);
return new Uint8Array(bytes);
}

View file

@ -0,0 +1,73 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.compareArrayBuffers = compareArrayBuffers;
// this are dev dependencies
var diff = require("jest-diff");
var _require = require("jest-diff/build/constants"),
NO_DIFF_MESSAGE = _require.NO_DIFF_MESSAGE;
var _require2 = require("@webassemblyjs/wasm-parser"),
decode = _require2.decode;
var oldConsoleLog = console.log;
function compareArrayBuffers(l, r) {
/**
* Decode left
*/
var bufferL = "";
console.log = function () {
for (var _len = arguments.length, texts = new Array(_len), _key = 0; _key < _len; _key++) {
texts[_key] = arguments[_key];
}
return bufferL += texts.join("") + "\n";
};
try {
decode(l, {
dump: true
});
} catch (e) {
console.error(bufferL);
console.error(e);
throw e;
}
/**
* Decode right
*/
var bufferR = "";
console.log = function () {
for (var _len2 = arguments.length, texts = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
texts[_key2] = arguments[_key2];
}
return bufferR += texts.join("") + "\n";
};
try {
decode(r, {
dump: true
});
} catch (e) {
console.error(bufferR);
console.error(e);
throw e;
}
console.log = oldConsoleLog;
var out = diff(bufferL, bufferR);
if (out !== null && out !== NO_DIFF_MESSAGE) {
throw new Error("\n" + out);
}
}

89
node_modules/@webassemblyjs/helper-buffer/lib/index.js generated vendored Normal file
View file

@ -0,0 +1,89 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.overrideBytesInBuffer = overrideBytesInBuffer;
exports.makeBuffer = makeBuffer;
exports.fromHexdump = fromHexdump;
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function concatUint8Arrays() {
for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {
arrays[_key] = arguments[_key];
}
var totalLength = arrays.reduce(function (a, b) {
return a + b.length;
}, 0);
var result = new Uint8Array(totalLength);
var offset = 0;
for (var _i = 0, _arrays = arrays; _i < _arrays.length; _i++) {
var arr = _arrays[_i];
if (arr instanceof Uint8Array === false) {
throw new Error("arr must be of type Uint8Array");
}
result.set(arr, offset);
offset += arr.length;
}
return result;
}
function overrideBytesInBuffer(buffer, startLoc, endLoc, newBytes) {
var beforeBytes = buffer.slice(0, startLoc);
var afterBytes = buffer.slice(endLoc, buffer.length); // replacement is empty, we can omit it
if (newBytes.length === 0) {
return concatUint8Arrays(beforeBytes, afterBytes);
}
var replacement = Uint8Array.from(newBytes);
return concatUint8Arrays(beforeBytes, replacement, afterBytes);
}
function makeBuffer() {
for (var _len2 = arguments.length, splitedBytes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
splitedBytes[_key2] = arguments[_key2];
}
// $FlowIgnore
var bytes = [].concat.apply([], splitedBytes);
return new Uint8Array(bytes).buffer;
}
function fromHexdump(str) {
var lines = str.split("\n"); // remove any leading left whitespace
lines = lines.map(function (line) {
return line.trim();
});
var bytes = lines.reduce(function (acc, line) {
var cols = line.split(" "); // remove the offset, left column
cols.shift();
cols = cols.filter(function (x) {
return x !== "";
});
var bytes = cols.map(function (x) {
return parseInt(x, 16);
});
acc.push.apply(acc, _toConsumableArray(bytes));
return acc;
}, []);
return new Uint8Array(bytes);
}

24
node_modules/@webassemblyjs/helper-buffer/package.json generated vendored Normal file
View file

@ -0,0 +1,24 @@
{
"name": "@webassemblyjs/helper-buffer",
"version": "1.12.1",
"description": "Buffer manipulation utility",
"main": "lib/index.js",
"module": "esm/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/xtuc/webassemblyjs.git"
},
"publishConfig": {
"access": "public"
},
"author": "Sven Sauleau",
"license": "MIT",
"devDependencies": {
"@webassemblyjs/wasm-parser": "1.12.1",
"jest-diff": "^24.0.0"
},
"gitHead": "67c75cf2da65e5588b5e81c10b0d7692d174760b"
}