zenchild/Viewpoint — Issue #30: Automatic deepening should be configurable
Author: daveespo
Created: 2011-12-15 15:32:29+00:00
State: open

I was troubleshooting a performance problem with pulling items out of a mailbox and discovered that if you reference a property that has not been returned by the server, Viewpoint is "helpful" and goes back to the server to do an AllProperties shape request to GetItem. This can cause code that iterates over a big mailbox to go from a single HTTP callout to N+1 callouts.

In my client code, I monkey patched deepen! to throw a big ugly NoMethodError since I never want deepening to happen automatically; I want to be forced to add the property I want to the additional_properties of the item_shape.

I'll submit a patch; I'm thinking that an argument to the constructor 'disable_automatic_deepening' and replace all calls to deepen! with a automatic_deepen which will throw an exception if disable_automatic_deepening is set. Fair enough?