Open Closed

Identity ABPUser synchronize problem because of Volo.Abp.Users.UserEto does not contains IsDeleted property #5234


User avatar
0
ElifKaya created

Hi,

We have own user entity and we want to always sync with ABPUser table. So. We used user synchronize method. There is no problem with user add or update operation. But, when we delete user from identity ABPUser table, ABP make soft delete and marked as a IsDeleted column is true. But Volo.Abp.Users.UserEto does not contains IsDeleted property so EntityUpdatedEto<UserEto> can not be triggered in user delete operation. As a result, we can not provide to synchronization. When the user is deleted from ABPUser, we continue to see that user in our module user table.

Can you add IsDeleted property to your UserEto class or give an another advice to solve this problem?

Thanks

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.3.3
  • UI type: / MVC /
  • DB provider: EF Core /
  • Tiered (MVC) or Identity Server Separated (Angular): yes /
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

8 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi, can you share exact screenshot or steps to reproduce this issue?

  • User Avatar
    0
    ElifKaya created

    Hi, can you share exact screenshot or steps to reproduce this issue?

    We have custom user entity(ModUsers). And we always listen to ABPUser table by using IDistributedEventHandler<EntityUpdatedEto<UserEto>>. And we aim to sync with our custom user data and ABPUser data in every cases.

    We can catch all changes in user creation and modification from ABPUser table. But, ABP make soft delete and marked as a IsDeleted column is true when user delete operation. But, Volo.Abp.Users.UserEto does not contains IsDeleted property so we can not catch a deleted user. It is not falling to IDistributedEventHandler<EntityUpdatedEto<UserEto>>. Because there is no IsDeleted property in your UserEto class.

    I shared the all necessary images above.

    Can you add IsDeleted property to your UserEto ?

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi,

    can you please handle EntityDeletedEto<T> is published when an entity of type T was deleted just like you have handled EntityUpdatedEto<T>

    Please see the documentation here https://docs.abp.io/en/abp/latest/Distributed-Event-Bus#event-types

  • User Avatar
    0
    ElifKaya created

    Hi,

    can you please handle EntityDeletedEto<T> is published when an entity of type T was deleted just like you have handled EntityUpdatedEto<T>

    Please see the documentation here https://docs.abp.io/en/abp/latest/Distributed-Event-Bus#event-types

    Hi,

    ABP User Delete endpoint (api/identity/users/{id}) makes just a SOFT DELETE (not a Hard Delete). Actually, it is a update operation (not a delete operation). IsDeleted property is marked as a TRUE by ABP when we request to delete user endpoint.

    So it is not a delete operation and it is a update operation. We should not use a EntityDeletedEto<T>. We need to IsDeleted property in Volo.Abp.Users.UserEto.

    Also I tried using it as you said anyway. But as I said, this api/identity/users/{id} api does a soft delete operation, not a hard delete. Therefore, EntityUpdatedEto<T> should be used, not EntityUpdatedEto<T>. Therefore, I think that the isDeleted field should be added to Volo.Abp.Users.UserEto.

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi, Just for your information there is HardDeleteAsync method using which you can permanently delete the entity record from database. can you please check this link https://docs.abp.io/en/abp/latest/Repositories

    Here EntityDeletedEto is trigger when a delete operation is called, even if it is a soft delete it is an delete operation, if you want your moduser to have soft delete please read more on https://docs.abp.io/en/abp/latest/Data-Filtering#isoftdelete

    Here is a video showing delete triggers. Click Here

    Thanks,

  • User Avatar
    0
    ElifKaya created

    Hi, Just for your information there is HardDeleteAsync method using which you can permanently delete the entity record from database. can you please check this link https://docs.abp.io/en/abp/latest/Repositories

    Here EntityDeletedEto is trigger when a delete operation is called, even if it is a soft delete it is an delete operation, if you want your moduser to have soft delete please read more on https://docs.abp.io/en/abp/latest/Data-Filtering#isoftdelete

    Here is the a snip showing delete triggers Thanks,

    Hi,

    Thank you for your example. Can you show me your delete api request, please? Because, we use "api/identity/users/{id}" this endpoint from ABP Identity Management. And, it doesn't trigger to EntityDeletedEto.

    I mean that, I don't want to hard delete or create another delete api. We just use a ABP Identity Management User Delete Action request. And I will continue to delete action from ABP Identity Management. So, Can you check your (api/identity/users/{id}) endpoint, please? Your user delete endpoint makes a soft delete.

    Or, Can you give an example by using your (api/identity/users/{id}) as you did above ?

    Thanks,

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi,

    Here you can see that this the same endpoint Click Here

  • User Avatar
    0
    ElifKaya created

    Hi,

    Here you can see that this the same endpoint Click Here

    Thank you so much, I will try again :)

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35