Open Closed

Client proxy service returns some duplicate data. #3363


User avatar
0
jeffbuot created
  • ABP Framework version: v5.3.0
  • Project type: Abp Microservice Template
  • DB provider: MongoDB
  • Steps to reproduce the issue:
  • Create new microservice project from abp suite
  • Change the database context of all microservices from efcore sqlserver to mongo db by following this steps from: https://docs.abp.io/en/commercial/latest/guides/microservice-mongodb
  • Run all services
  • Seed product data as many as you like ProductService.HttpApi.Host
  • Adjust the LimitedResultRequestDto.DefaultMaxResultCount to a large number e.g.200000 -Use the ProductService.HttpApi.Client for client remote service using WPF -Get the data using the client proxy GetListAsync() multiple times with SkipCount up to TotalCount

There is something wrong with the data returned here.. even I used SkipCount it doesn't seems to be skipping and returns the same value. Also when I try to change the initialFetchCount e.g. 20k, 10 or 20 the GetListAsync() sometimes has a duplicate data from the recent collection results. There's a scenario I fetched 300k+ data with multiple server calls I got about 6 data duplicate instances.

var initialFetchCount = 1;
var products = await ProductClientProxy.GetListAsync(new GetProductsInput
                    {Sorting = "Name ASC", MaxResultCount = initialFetchCount});
var products2 = await ProductClientProxy.GetListAsync(new GetProductsInput
                    {Sorting = "Name ASC",SkipCount = initialFetchCount, MaxResultCount = initialFetchCount});
var products3 = await ProductClientProxy.GetListAsync(new GetProductsInput
                    {Sorting = "Name ASC",SkipCount = initialFetchCount*2, MaxResultCount = initialFetchCount});

7 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    We will check it.

  • User Avatar
    0
    jeffbuot created

    Hi,

    We will check it.

    Hi,

    How's it going on?

  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hi, I've spent quite a bit of time on the problem but I'm having trouble reproducing it. I don't think the problem is related to static-proxy, but to confirm my assumption, I need to know if you are facing the same problem when you send a request to product-service via swagger. Also, I would appreciate it if you could provide a minimally reproducible example for healthier tests.

  • User Avatar
    0
    jeffbuot created

    Hi berkansasmaz,

    Thanks for your response, yes I still face the same issue via swagger. I'll give you screenshots on what I got.

  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hello again, thank you very much for the information you provided. I tried again with 19064 records, but I couldn't reproduce it again. I'll add more records and try, but I have one more question.

    What kind of result do you get when you run queries that cover the following situations on the database server? https://www.mongodb.com/docs/compass/current/query/skip/

    {"skip": 0, "limit": 1, "batchSize": 2, "sort": { "Name": 1 }}

    {"skip": 1, "limit": 1, "batchSize": 2, "sort": { "Name": 1 }}

    {"skip": 2, "limit": 1, "batchSize": 2, "sort": { "Name": 1 }}

    I need this answer to make sure the problem is not data related.

  • User Avatar
    0
    jeffbuot created

    Hi,

    I found out that I sort the wrong field, the Name sorting is causing the issue. The data I have has multiple products that has the same Name, so for example I have 5 names which is "A A" then query with

    {"skip": 0, "limit": 1, "sort": { "Name": 1 }}
    
    {"skip": 1, "limit": 1, "sort": { "Name": 1 }}
    
    {"skip": 2, "limit": 1, "sort": { "Name": 1 }}
    

    will show the same result which if queried by sort of Name.

    So instead I used the CreationTime field to sort.

  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Thanks for the information, I'm closing it now that the problem is solved.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on June 13, 2025, 11:37