Skip to content

Commit

Permalink
Merge pull request #1175 from JGreenlee/debugging-sep2024
Browse files Browse the repository at this point in the history
Make it easier to debug issues with draft trips
  • Loading branch information
shankari authored Sep 12, 2024
2 parents d12df99 + ed3ea1c commit b426c9a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions config.cordovabuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<content src="index.html" />
<access origin="*" />
<hook src="hooks/before_prepare/download_translation.js" type="before_prepare" />
<preference name="InspectableWebview" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
Expand Down
1 change: 1 addition & 0 deletions config.serve.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<content src="index.html" />
<access origin="*" />
<hook src="hooks/before_prepare/download_translation.js" type="before_prepare" />
<preference name="InspectableWebview" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
Expand Down
17 changes: 10 additions & 7 deletions www/js/diary/timelineHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,16 @@ export function readUnprocessedTrips(

logDebug(`mapping trips to tripObjs of size ${rawTripObjs.length}`);
/* Filtering: we will keep trips that are 1) defined and 2) have a distance >= 100m,
or duration >= 5 minutes
https://github.com/e-mission/e-mission-docs/issues/966#issuecomment-1709112578 */
const tripObjs = rawTripObjs.filter(
(trip) => trip && (trip.distance >= 100 || trip.duration >= 300),
);
logDebug(`after filtering undefined and distance < 100m,
tripObjs size = ${tripObjs.length}`);
or duration >= 5 minutes
https://github.com/e-mission/e-mission-docs/issues/966#issuecomment-1709112578 */
const tripObjs = rawTripObjs.filter((trip) => {
if (!trip || trip.distance < 100 || trip.duration < 300) {
logDebug(`Trip ${JSON.stringify(trip)} is falsy, < 100m, or < 5 min. Dropping`);
return false;
}
return true;
});
logDebug(`after filtering, tripObjs size = ${tripObjs.length}`);
// Link 0th trip to first, first to second, ...
for (let i = 0; i < tripObjs.length - 1; i++) {
linkTrips(tripObjs[i], tripObjs[i + 1]);
Expand Down

0 comments on commit b426c9a

Please sign in to comment.