Skip to content

Conversation

@apeters
Copy link
Member

@apeters apeters commented Jan 6, 2026

No description provided.

@apeters apeters requested a review from chrabyrd January 6, 2026 22:00
@apeters apeters self-assigned this Jan 6, 2026
Copy link
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Howdy howdy. Thought you wouldn't mind having a couple notes, hope it helps!

Comment on lines 134 to 136
delete_missing_tiles = (
self.request.GET.get("delete_missing_tiles", "").lower() == "true"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl;dr this should already be stored as self.partial (should have been self.is_partial_update or self.leave_missing_children_alone, I guess).

The goal was always to push requests out the model layer entirely. It's here as a concession to support legacy post tile save functions. If you need this in a hurry, hopefully we can capture a follow-up to remove it?

If you're writing your own views, then you can parse args exactly how you like. If you're using the framework, here is where the view layer passes down arguments to the save method's partial= arg.

# Freeze some keyword arguments to the model save() method.
is_partial_update = self.request.method == "PATCH"
ret.save = partial(ret.save, request=self.request, partial=is_partial_update)

Looking at this now, partial=... is a terrible name given it's rhyming with functools.partial here.

(Is that spooky action at a distance? I guess. The tradeoff being action at a distance versus having to remember to call save() different ways in different views. And the idea being you could always write your own view if you got tired of doing it the framework-way, but otherwise try to provide reasons not to write your own view.)

Copy link
Member

@jacobtylerwalls jacobtylerwalls Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I'm not familiar with what request.GET looks like on put/patch requests, does it still give you querystring args? So it does!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @jacobtylerwalls I'll look into the self.partial property. I think we'll still need to have the abilty to pass in a querystring param (which btw, works on PUT and PATCH requests just like it does for GETs), to allow users to opt in/out of tile deletes.

Comment on lines 277 to 278
if tile._state.adding:
tile.set_missing_keys_to_none()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't clear on how much of an error condition this was to have missing keys; I thought we had a lot of knockout code that errored out pretty hard on them. Is the idea to gate this for inserts only, so that we take a "light touch" with existing tiles?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to look into this again. This check may be rendered useless now that a more final fix is in place. I think at first this was causing an issue.


for tile in incoming_tiles:
if tile in self.to_delete:
# Need to remove tiles flagged for deletion if they are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch. I'd love to hear a little bit more about what you found here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing pairs of tile id's from _pair_tiles cause this issue becuase they are considered "deleted" when in fact on a subsequent loop through the code those "deleted" tiles are in fact being updated.

Honestly, there is probably a deeper refactor required here that our budget just can't afford.

Copy link
Contributor

@chrabyrd chrabyrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good, haven't given it a spin yet. 1 nit 😁

grouping_node.alias
]:
if str(existing_tile.nodegroup_id) in self.deletable_nodegroups:
# print(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 😄

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.

4 participants