preload: split out recording logic from connect() override