Skip to content

Fix the view lastpos response. #471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

patthoyts
Copy link
Contributor

The locarray json data is transferred to the response object and if it is deleted here results in an empty object being returned to the user and the default view just shows "Imported data is malformed" instead of a map. This restores the vmap functionality.

The locarray json data is transferred to the response object and if
it is deleted here results in an empty object being returned to the user
and the default view just shows "Imported data is malformed" instead of
a map. This restores the vmap functionality.

Signed-off-by: Pat Thoyts <pat.thoyts@gmail.com>
@jpmens jpmens merged commit 5f27238 into owntracks:master Jun 15, 2024
@jpmens
Copy link
Member

jpmens commented Jun 15, 2024

Merged, thank you!

@jpmens
Copy link
Member

jpmens commented Jun 15, 2024

I think this might re-open one of the memory leaks we closed in #464

Needs investigation.

@jpmens jpmens self-assigned this Jun 15, 2024
@patthoyts patthoyts deleted the correct-view-lastpos branch June 15, 2024 11:36
@patthoyts
Copy link
Contributor Author

I'm fairly sure this does not re-introduce a leak. The locarray is attached as the data member of the response object. In the json_response function this object is deleted by json_delete() which iterates over its members and calls delete on each which then deals with the locarray.

I gave valgrind a try and there is no difference between making a single call to get the view lastpos and making 20 such calls.

@jpmens
Copy link
Member

jpmens commented Jun 15, 2024

Thank you very much for doing that, Pat -- much appreciated, as I won't have to dig out ye olde valgrinde myself. :-)

@jpmens jpmens removed their assignment Jun 15, 2024
jpmens added a commit that referenced this pull request Jul 23, 2024
- FIX: add card data to websocket notifications (#450)
- FIX: Enable building when WITH_TZ=no to disable timezone information (#473)
- FIX: view lastpos response (#471)
- FIX: handle out-of-order location notification in last/ (#472)
- FIX: drastically reduce memory leakage in views (#464)
- FIX: reformat json if it contains newlines/tabs before storing in .rec (#437)
- NEW: cached geo records can be auto-expired by setting OTR_CLEAN_AGE (#447)
- NEW: option -J prints variables in JSON format, for scripting
- NEW: version is printed in -J / -V
- FIX: in http mode friends' data must contain a topic; construct it or retrieve from last if available (#451)
- FIX: crash on non-string event name in _transition messages (#454)
- NEW: Add alt field to GeoJSON points parameters (#456)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants