[dev] Fix a bug where `pruneConnection` might return blank value