microsoft / microsoft/powerbi-visuals-api

Bug Report: fetchMoreData() not triggering update() after persistProperties() with segmented data

Open
#100 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
108
Forks
48
PR merge metrics
No merged PRs in 30d

Description

Description

When a custom visual loads more than 30,000 rows, the initial load works correctly. However, after calling host.persistProperties(...), it triggers an update() with VisualUpdateType.Data that correctly indicates more segments are available (dataView.metadata.segment is present). When calling host.fetchMoreData(false), it returns true indicating more data is available, but the update() method is never called again and the remaining data is not loaded.

Expected Behavior

After host.fetchMoreData(false) returns true, the update() method should be called again with the next segment of data, allowing the visual to load all available data iteratively.

Actual Behavior
  • fetchMoreData(false) returns true
  • No subsequent update() call is triggered
  • Data remains incomplete (stuck at initial segment)
Steps to Reproduce
  1. Create a custom visual with data > 30,000 rows
  2. Configure capabilities.json with data reduction algorithm:
{
  "dataViewMappings": [{
    "table": {
      "rows": {
        "for": { "in": "values" },
        "dataReductionAlgorithm": {
          "top": { "count": 30000 }
        }
      }
    }
  }]
}
  1. In the visual code, implement the following:
public update(options: VisualUpdateOptions) {
    const dataView = options.dataViews?.[0];
    
    if (!dataView) return;
    
    // First load works correctly
    this.processData(dataView);
       
    if (dataView.metadata?.segment) {
        console.log("Has more segments"); // This logs correctly
        
        const hasMore = this.host.fetchMoreData(false);
        console.log("fetchMoreData returned:", hasMore); // Returns true
        
        // rest of the logic
    }
}
  1. Call persistProperties after the data was loaded
    // Call persistProperties for any reason
    this.host.persistProperties({
        merge: [{
            objectName: "settings",
            selector: null,
            properties: { someProperty: "value" }
        }]
    });

This triggers update() again with VisualUpdateType.Data. There is dataView.metadata?.segment and this.host.fetchMoreData(false) returns true, but the update() is not triggered anymore.

Observe that:

  • Initial 30,000 rows load successfully
  • persistProperties() triggers update()
  • dataView.metadata.segment exists
  • fetchMoreData(false) returns true
  • But update() is never called again with the next segment
Environment
  • Power BI Visual API Version: 5.11.0
  • Node Version: v18.20.0
  • Operating System: Windows 11
Additional Context

This issue only occurs when:

  1. Data has multiple segments (> 30,000 rows)
  2. persistProperties() is called
  3. The subsequent update() attempts to fetch more data

Impact: This prevents visuals from:

  • Loading complete datasets when properties need to be saved
  • Implementing features that require both data segmentation and property persistence
  • Maintaining state while progressively loading large datasets

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the custom visual's update entry point and capabilities.json, using the supplied reproduction with more than 30,000 rows on Power BI Visual API 5.11.0. Trace the interaction between persistProperties(), the segmented dataView, and fetchMoreData(false). Done means a subsequent update() receives the next segment after fetchMoreData(false) returns true.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.