Merge pull request #562 from sharelatex/sk-fix-references-full-index

Account for the new `referencesSearch` flag in full-index decision
This commit is contained in:
Shane Kilkelly 2018-05-14 14:06:00 +01:00 committed by GitHub
commit 607bd3f6a5
2 changed files with 12 additions and 1 deletions

View file

@ -46,7 +46,8 @@ module.exports = ReferencesHandler =
_isFullIndex: (project, callback = (err, result) ->) ->
UserGetter.getUser project.owner_ref, { features: true }, (err, owner) ->
return callback(err) if err?
callback(null, owner?.features?.references == true)
features = owner?.features
callback(null, features?.references == true || features?.referencesSearch == true)
indexAll: (projectId, callback=(err, data)->) ->
ProjectGetter.getProject projectId, {rootFolder: true, owner_ref: 1}, (err, project) ->

View file

@ -385,3 +385,13 @@ describe 'ReferencesHandler', ->
@call (err, isFullIndex) =>
expect(err).to.equal null
expect(isFullIndex).to.equal false
describe 'with referencesSearch', ->
beforeEach ->
@owner.features = {referencesSearch: true, references: false}
it 'should return true', ->
@call (err, isFullIndex) =>
expect(err).to.equal null
expect(isFullIndex).to.equal true