temporal: prohibit writing map timestamps across mapsets#7211
temporal: prohibit writing map timestamps across mapsets#7211Dasux wants to merge 2 commits intoOSGeo:mainfrom
Conversation
ninsbl
left a comment
There was a problem hiding this comment.
Looks good to me. Have not tested if it completely fixes the issue. But it is an improvement in any case...
|
Thanks for the feedback, currently it does not work as intended... I'll get back to you after i append the changes to the other methods |
|
I think you should set up a pytest-based test for this so that it clear when writing is working and when is is (intentionally) blocked. |
@wenzeslaus --- ill look into it... My initial guess, about changing the logic when One thing to note tho: I think the pipeline is something like this: It seems the C layer correctly enforces mapset ownership and rejects writes when the map is not in the current mapset. However, the Python layer may not be properly handling this failure, leading to inconsistent behavior. I'm still investigating to pinpoint where the mismatch happens. I'll setup a pytest-based test to verify the blocked and allowed test cases. |
|
Not quite sure what is going on here. I did not dig deeper into the issue. It only occurrs with vector maps (though raster timestamps may be written to the GRASS DB, I hdid not check that). A test would be great! |
|
r.info vs r.timestamp: yes separate issue raster vs vector: Probably both, again, a test will clarify for everyone |
This PR addresses issue #3394
The problem was when registering a map like
lakes@PERMANENT, the temporal framework attempts to write timestamp data into the current mapset. This created an invalid map entry e.g,lakes@to_verifywithout the actual vector data.The reason was ... the function
write_timestamp_to_grass()is called without verifying that the map belongs to the current mapset.Fix made:
Added an additional condition in the function
update_absolute_time()... to verify if map is in its own mapset or not.Additional note:
I found multiple instances of
write_timestamp_to_grass... I've added the condition only in one of the methods... I wanted to confirm if this was the intended change required before proceeding with the other methods...