lib: emit events when reaching 'files' and 'fields' limits