Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1026

Log warnings instead of throwing for unsupported BSON types

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.2
    • Affects Version/s: 1.3.0
    • Component/s: None
    • None

      PHPC-302 introduced exceptions for unsupported BSON types (i.e. undefined, symbol, DBPointer). Since 1.3.0 was released, we discovered that a number of users have undefined types in their documents and were relying on the driver's previous behavior, which ignored these fields when converting BSON to PHP. Exceptions introduced in 1.3.0 now make it impossible for these users to work with their documents. Discovery and data sanitization is not feasible as offending values can be scattered across various fields and documents.

      Reverting this exception behavior will take us back to the point where round-tripping BSON through the PHP driver can result in the loss of fields with these three types. Ultimately, we'll need to introduce classes for these deprecated types in 1.4.0 to address that.

      In place of exceptions, we can have the handlers log a message, as php_phongo_bson_visit_corrupt() currently does. The trace level may be too light, so we may want to increase that (both for new log messages and php_phongo_bson_visit_corrupt() while we're at it).

            Assignee:
            derick Derick Rethans
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: