SyliusResourceBundle icon indicating copy to clipboard operation
SyliusResourceBundle copied to clipboard

Remove resource when redirect on delete

Open Jibbarth opened this issue 3 years ago • 9 comments

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #X, partially #Y, mentioned in #Z
License MIT

Hi team :wave:

I add this issue when trying to call deleteAction on a custom entity.

The fact is my entity is strongly typed, and there is no nullable id on it :

class Entity implement ResourceInterface
{ 
    private int $id;
    
    public function getId(): int
    { 
        return $this->id;
    }
}

Passing the resource on this redirectToIndex force it to look in the resource for any id parameters (here), and it's raised an exception while trying to access to a property not initialized.

I guess on a deleteAction, it's not mandatory to retrieve the previous id, so we can safely remove it ?

I just submit quickly this patch to see if every tests passes, if it's not the case, i'll look deeper what happen. WDYT ?

Jibbarth avatar Feb 02 '22 16:02 Jibbarth

Merged with the latest state of master to fix conflicts.

kachayev avatar Mar 18 '18 19:03 kachayev

@ztellman Merged with the latest changes from master (there were quite a few)

kachayev avatar Apr 23 '18 13:04 kachayev

Sorry, I managed to completely forget about this. I'm going on vacation in a few days, so it may be a few weeks before I can do a deep dive, but I just wanted register my intent to get this reviewed and merged.

ztellman avatar Jul 12 '18 17:07 ztellman

@ztellman Sure, no worries. When this is merged, I will create another PR with the setting to send pings periodically after idle timeout (a.k.a heartbeating). Just don't want to mess everything up in a single PR.

kachayev avatar Jul 12 '18 21:07 kachayev

Updated.

kachayev avatar Aug 09 '18 21:08 kachayev

Updated the same PR with periodical ping/pong heartbeats.

kachayev avatar Aug 10 '18 20:08 kachayev

Merged with the latest master to avoid conflicts.

kachayev avatar Jan 28 '19 21:01 kachayev

I'm sorry this took so long to review. It looks good to me, merging.

ztellman avatar Feb 01 '19 23:02 ztellman

Hey I'm looking for a way to manually send pings, and I ended up at the issues referenced here. But websocket-ping and heartbeats are both gone now, where can I find the discussion about that change?

matthewdowney avatar Sep 11 '20 22:09 matthewdowney

@matthewdowney websocket-ping function is in here. Not sure what do you mean by "gone" 🤔

kachayev avatar Sep 12 '20 06:09 kachayev

Ah thank you so much! I was looking in http.clj. I should have checked if it was in another namespace, my apologies.

matthewdowney avatar Sep 12 '20 15:09 matthewdowney

No problems at all, @matthewdowney!

kachayev avatar Sep 12 '20 23:09 kachayev