Skip to content

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

@luizzappa

Description

@luizzappa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions