Backported dataAvailable to 2.4 (squashed)

See Pull request #1098