dutchcoders / slackarchive

Archiver for Slack Teams
301 stars 27 forks source link

Importer doesn't find team #16

Open martinb3 opened 6 years ago

martinb3 commented 6 years ago

Hi there -- I'm using slackarchive and the importer, and I'm noticing this chunk of code always fails from importer.go:

    t := models.Team{}
    if err := i.db.Teams.FindId(team.ID).One(&t); err == nil {
        log.Debug("Team already exists: %s", t.ID)
    } else {
                // fails
        return nil, err
    }

What would create the team in the database? I can't find any team creation in the slackarchive or slackarchive-init projects.

yanokwa commented 6 years ago

Are you still having this problem, @martinb3?

noisymime commented 6 years ago

Not OP, but I'm still seeing the same issue on one of my imports

yanokwa commented 6 years ago

It sounds like some imports work and others don't. What's the difference between those imports?

martinb3 commented 6 years ago

Yes, I ended up locally modifying it to work around this problem. I still could never find any reason the team should exist in the database before the other import steps. I suspect this line is fine on an existing import, but was never tested on an empty database.